@Test public void convertMultipleKeyPairs() { final String pubA = "publicA"; final String privA = "privateA"; final String pubB = "publicB"; final String privB = "privateB"; final DirectKeyPair keyPairA = new DirectKeyPair(pubA, privA); final DirectKeyPair keyPairB = new DirectKeyPair(pubB, privB); final Collection<KeyPair> result = converter.convert(Arrays.asList(keyPairA, keyPairB)); assertThat(result).hasSize(2); final KeyPair expectedA = new KeyPair(PublicKey.from(decodeBase64(pubA)), PrivateKey.from(decodeBase64(privA))); final KeyPair expectedB = new KeyPair(PublicKey.from(decodeBase64(pubB)), PrivateKey.from(decodeBase64(privB))); final Iterator<KeyPair> it = result.iterator(); final KeyPair resultA = it.next(); assertThat(resultA).isEqualToComparingFieldByField(expectedA); final KeyPair resultB = it.next(); assertThat(resultB).isEqualToComparingFieldByField(expectedB); }
public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } KeyPairConverter(Config config, EnvironmentVariableProvider envProvider); }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } KeyPairConverter(Config config, EnvironmentVariableProvider envProvider); Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs); List<PublicKey> convert(List<String> values); }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } KeyPairConverter(Config config, EnvironmentVariableProvider envProvider); Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs); List<PublicKey> convert(List<String> values);  }