### Question:
IPv6 implements Comparable<IPv6> { public static byte[] IpString2bytes(String ipStr) throws IPStringConversionException { int i; int j; int val; byte[] out; String expanded_ipStr; Matcher ipMatch = ipPattern.matcher(ipStr); if (ipMatch.find()) { String hex_part = ipMatch.group(1); String ip4_part = ipMatch.group(2); if (hex_part == null && ip4_part == null) { hex_part = ipMatch.group(3); ip4_part = ipMatch.group(4); } IPv4 ipv4 = new IPv4(ip4_part); byte[] ipv4_bytes = ipv4.getBytes(); byte[] hex_bytes = hex_part.getBytes(); int last = hex_bytes.length - 1; int hi_word = (BitConverters.ubyte2int(ipv4_bytes[0]) << 8) + (BitConverters.ubyte2int(ipv4_bytes[1])); int lo_word = (BitConverters.ubyte2int(ipv4_bytes[2]) << 8) + (BitConverters.ubyte2int(ipv4_bytes[3])); String hi_str = BitConverters.int16bit2hex(hi_word); String lo_str = BitConverters.int16bit2hex(lo_word); expanded_ipStr = expand(hex_part, 6) + String.format(":%s:%s", hi_str, lo_str); } else { String hex_part = ipStr; expanded_ipStr = expand(hex_part, 8); } i = 0; out = new byte[16]; for (String word : expanded_ipStr.split(":")) { val = BitConverters.hex16bit2int(word); out[i] = BitConverters.int2ubyte((val & 0xff00) >> 8); out[i + 1] = BitConverters.int2ubyte((val & 0x00ff)); i += 2; } return out; } IPv6(BigInteger in);  IPv6();  IPv6(String ip);  IPv6(byte[] in); static String expand(String ipStr, int nwords); String expand(); BigInteger toBigInteger(); static IPv6 bigInteger2IPv6(BigInteger in); static byte[] IpString2bytes(String ipStr); static String bytes2IpString(byte[] in); void setIp(byte[] in); String getString(); byte[] getBytes(); void setIp(String ip); void insertInteger(int in, int startBit); void insertBigInteger(BigInteger in, int startBit, int size); void setAccountPartition(int accountId); void setVipOctets(int lo); int getVipOctets(); void setClusterPartition(IPv6Cidr clusterCidr); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(IPv6 that);  }### Answer:
@Test public void testIPv4Mixed() throws IPStringConversionException { assertTrue("Expected IPv4 mixed address to work", bytes_match(ipv4Mixed_bytes, IPv6.IpString2bytes(ipv4Mixed_compressed))); }