### Question:
EnodeURL { public static Bytes parseNodeId(final String nodeId) { int expectedSize = EnodeURL.NODE_ID_SIZE * 2; if (nodeId.toLowerCase().startsWith("0x")) { expectedSize += 2; } checkArgument( nodeId.length() == expectedSize, "Expected " + EnodeURL.NODE_ID_SIZE + " bytes in " + nodeId); return Bytes.fromHexString(nodeId, NODE_ID_SIZE); } private  EnodeURL(
      final Bytes nodeId,
      final InetAddress address,
      final Optional<String> maybeHostname,
      final Optional<Integer> listeningPort,
      final Optional<Integer> discoveryPort); static Builder builder(); static EnodeURL fromString(final String value); static EnodeURL fromString(
      final String value, final EnodeDnsConfiguration enodeDnsConfiguration); static EnodeURL fromURI(final URI uri); static EnodeURL fromURI(final URI uri, final EnodeDnsConfiguration enodeDnsConfiguration); static boolean sameListeningEndpoint(final EnodeURL enodeA, final EnodeURL enodeB); static Bytes parseNodeId(final String nodeId); URI toURI(); URI toURIWithoutDiscoveryPort(); static URI asURI(final String url); static URI asURI(final String url, final EnodeDnsConfiguration enodeDnsConfiguration); Bytes getNodeId(); String getIpAsString(); InetAddress getIp(); boolean isListening(); boolean isRunningDiscovery(); Optional<Integer> getListeningPort(); int getListeningPortOrZero(); Optional<Integer> getDiscoveryPort(); int getDiscoveryPortOrZero(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final int DEFAULT_LISTENING_PORT; static final int NODE_ID_SIZE; }### Answer:
@Test public void parseNodeId_invalid() { final String invalidId = "0x10"; assertThatThrownBy(() -> EnodeURL.parseNodeId(invalidId)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Expected 64 bytes in " + invalidId); }
@Test public void parseNodeId_valid() { final String validId = VALID_NODE_ID; final Bytes nodeId = EnodeURL.parseNodeId(validId); assertThat(nodeId.size()).isEqualTo(EnodeURL.NODE_ID_SIZE); assertThat(nodeId.toUnprefixedHexString()).isEqualTo(validId); }