Rather than using a temporary map followed by ImmutableMap.copyOf(),
use ImmutableMap's collector.
Change-Id: Id4cad5f8027692b4beabfc9fc532ed4249b62aa6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c56f5861bc2294f659b8262438e7b157c4ae4456)
}
private static Map<TablesKey, SendReceive> mapTableTypesFamilies(final List<AddressFamilies> addPathTablesType) {
- return ImmutableMap.copyOf(addPathTablesType.stream().collect(Collectors.toMap(af -> new TablesKey(af.getAfi(),
- af.getSafi()), BgpAddPathTableType::getSendReceive)));
+ return addPathTablesType.stream().collect(ImmutableMap.toImmutableMap(
+ af -> new TablesKey(af.getAfi(), af.getSafi()), BgpAddPathTableType::getSendReceive));
}
public synchronized void instantiateServiceInstance() {