### Question:
IPv4 implements Writable, Comparable<IPv4> { @Override public boolean equals(Object o) { if (o instanceof IPv4) { byte[] obytes = ((IPv4)o).getBytes(); for (int i = 0; i < 4; i++) { if (this.ipBytes[i] != obytes[i]) { return false; } } return true; } return false; } IPv4();  IPv4(byte[] bytes);  IPv4(String ipAddress); static IPv4 getSubnetMask(int len); void set(String ipAddress); void set(byte[] bytes); byte[] getBytes(); boolean matchSubnet(String addr); boolean matchGeoIP(/* country code */); IPv4 and(IPv4 other); @Override boolean equals(Object o); @Override int compareTo(IPv4 o); @Override String toString(); @Override int hashCode(); @Override void readFields(DataInput in); @Override void write(DataOutput out);  }### Answer:
@Test public final void testEqual() throws InvalidAddressException { IPv4 ip1 = new IPv4("163.152.23.1"); IPv4 ip2 = new IPv4("163.152.23.2"); IPv4 ip3 = new IPv4("163.152.23.1"); assertTrue(ip1.equals(ip3)); assertFalse(ip1.equals(ip2)); IPv4 ip4 = new IPv4("255.255.0.0"); assertFalse(ip1.equals(ip4)); }