@Test public void fromInetSocketAddress_shouldConvertIpV6Peer() throws Exception { final byte[] ipAddress = Bytes.fromHexString("0x33000004500007800000001200000001").toArray(); final int port = 5883; final InetSocketAddress address = new InetSocketAddress(InetAddress.getByAddress(ipAddress), port); final Multiaddr result = MultiaddrUtil.fromInetSocketAddress(address); assertThat(result).isEqualTo(Multiaddr.fromString("/ip6/3300:4:5000:780:0:12:0:1/tcp/5883/")); assertThat(result.getComponent(Protocol.IP6)).isEqualTo(ipAddress); assertThat(result.getComponent(Protocol.TCP)).isEqualTo(Protocol.TCP.addressToBytes("5883")); assertThat(result.getComponent(Protocol.P2P)).isNull(); }
static Multiaddr fromInetSocketAddress(final InetSocketAddress address) { return fromInetSocketAddress(address, "tcp"); }
MultiaddrUtil { static Multiaddr fromInetSocketAddress(final InetSocketAddress address) { return fromInetSocketAddress(address, "tcp"); } }
MultiaddrUtil { static Multiaddr fromInetSocketAddress(final InetSocketAddress address) { return fromInetSocketAddress(address, "tcp"); }  }
MultiaddrUtil { static Multiaddr fromInetSocketAddress(final InetSocketAddress address) { return fromInetSocketAddress(address, "tcp"); }  static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer); static Multiaddr fromDiscoveryPeerAsUdp(final DiscoveryPeer peer); static Multiaddr fromInetSocketAddress(
      final InetSocketAddress address, final NodeId nodeId); }
MultiaddrUtil { static Multiaddr fromInetSocketAddress(final InetSocketAddress address) { return fromInetSocketAddress(address, "tcp"); }  static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer); static Multiaddr fromDiscoveryPeerAsUdp(final DiscoveryPeer peer); static Multiaddr fromInetSocketAddress(
      final InetSocketAddress address, final NodeId nodeId);  }