@Test public void shouldConvertRealEnrToDiscoveryPeer() throws Exception { final String enr = "-Iu4QMmfe-EkDnVX6k5i2LFTiDQ-q4-Cb1I01iRI-wbCD_r4Z8eujNCgZDmZXb1ZOPi1LfJaNx3Bd0QUK9wqBjwUXJQBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQO4btn3R6f6mZY_OeOxdrRenoYxCKLRReo6TnbY0JNRlIN0Y3CCIyiDdWRwgiMo"; final NodeRecord nodeRecord = NodeRecordFactory.DEFAULT.fromBase64(enr); final DiscoveryPeer expectedPeer = new DiscoveryPeer( Bytes.fromHexString( "0x03B86ED9F747A7FA99963F39E3B176B45E9E863108A2D145EA3A4E76D8D0935194"), new InetSocketAddress(InetAddress.getByAddress(new byte[] {127, 0, 0, 1}), 9000), Optional.empty(), PERSISTENT_SUBNETS); assertThat(convertToDiscoveryPeer(nodeRecord)).contains(expectedPeer); }
static Optional<DiscoveryPeer> convertToDiscoveryPeer(final NodeRecord nodeRecord) { return nodeRecord .getTcpAddress() .map(address -> socketAddressToDiscoveryPeer(nodeRecord, address)); }
NodeRecordConverter { static Optional<DiscoveryPeer> convertToDiscoveryPeer(final NodeRecord nodeRecord) { return nodeRecord .getTcpAddress() .map(address -> socketAddressToDiscoveryPeer(nodeRecord, address)); } }
NodeRecordConverter { static Optional<DiscoveryPeer> convertToDiscoveryPeer(final NodeRecord nodeRecord) { return nodeRecord .getTcpAddress() .map(address -> socketAddressToDiscoveryPeer(nodeRecord, address)); }  }
NodeRecordConverter { static Optional<DiscoveryPeer> convertToDiscoveryPeer(final NodeRecord nodeRecord) { return nodeRecord .getTcpAddress() .map(address -> socketAddressToDiscoveryPeer(nodeRecord, address)); }   }
NodeRecordConverter { static Optional<DiscoveryPeer> convertToDiscoveryPeer(final NodeRecord nodeRecord) { return nodeRecord .getTcpAddress() .map(address -> socketAddressToDiscoveryPeer(nodeRecord, address)); }    }