Use Stream.{of,concat}
[netconf.git] / netconf / netconf-netty-util / src / main / java / org / opendaylight / netconf / nettyutil / handler / ssh / client / NetconfClientBuilder.java
index c8ca24e4ea1809bdebb5797ca884320b0b290b27..0d1c361e574acc2ce3e336bd9fc2991ce56951c7 100644 (file)
@@ -11,8 +11,6 @@ import static com.google.common.base.Verify.verify;
 
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Streams;
-import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Stream;
 import org.opendaylight.netconf.shaded.sshd.client.ClientBuilder;
@@ -31,17 +29,17 @@ public class NetconfClientBuilder extends ClientBuilder {
     // RFC8332 rsa-sha2-256/rsa-sha2-512 are not a part of Mina's default set of signatures for clients as of 2.5.1.
     // Add them to ensure interop with modern highly-secured devices.
     private static final ImmutableList<NamedFactory<Signature>> FULL_SIGNATURE_PREFERENCE =
-            Streams.concat(DEFAULT_SIGNATURE_PREFERENCE.stream(), Arrays.asList(
-                BuiltinSignatures.rsaSHA512, BuiltinSignatures.rsaSHA256).stream())
+            Stream.concat(DEFAULT_SIGNATURE_PREFERENCE.stream(), Stream.of(
+                BuiltinSignatures.rsaSHA512, BuiltinSignatures.rsaSHA256))
             .filter(BuiltinSignatures::isSupported)
             .distinct()
-            .collect(ImmutableList.<NamedFactory<Signature>>toImmutableList());
+            .collect(ImmutableList.toImmutableList());
 
     // The SHA1 algorithm is disabled by default in Mina SSHD since 2.6.0.
     // More details available here: https://issues.apache.org/jira/browse/SSHD-1004
     // This block adds diffie-hellman-group14-sha1 back to the list of supported algorithms.
     private static final ImmutableList<BuiltinDHFactories> FULL_DH_FACTORIES_LIST =
-        Streams.concat(DEFAULT_KEX_PREFERENCE.stream(), Stream.of(BuiltinDHFactories.dhg14))
+        Stream.concat(DEFAULT_KEX_PREFERENCE.stream(), Stream.of(BuiltinDHFactories.dhg14))
             .collect(ImmutableList.toImmutableList());
     private static final List<KeyExchangeFactory> FULL_KEX_PREFERENCE =
         NamedFactory.setUpTransformedFactories(true, FULL_DH_FACTORIES_LIST, DH2KEX);