ARP extends Packet { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((fieldValues == null) ? 0 : fieldValues.hashCode()); return result; } ARP();  ARP(boolean writeAccess); short getHardwareType(); short getProtocolType(); byte getHardwareAddressLength(); byte getProtocolAddressLength(); short getOpCode(); byte[] getSenderHardwareAddress(); byte[] getSenderProtocolAddress(); byte[] getTargetHardwareAddress(); ARP setHardwareType(short hardwareType); ARP setProtocolType(short protocolType); ARP setHardwareAddressLength(byte hardwareAddressLength); ARP setProtocolAddressLength(byte protocolAddressLength); ARP setOpCode(short opCode); ARP setSenderHardwareAddress(byte[] senderHardwareAddress); ARP setTargetHardwareAddress(byte[] targetHardwareAddress); ARP setTargetProtocolAddress(byte[] targetProtocolAddress); ARP setSenderProtocolAddress(byte[] senderIP); byte[] getTargetProtocolAddress(); @Override int hashCode(); @Override boolean equals(Object obj); static short HW_TYPE_ETHERNET; static short REQUEST; static short REPLY; static short PROTO_TYPE_IP; }
@Test public void testHashCode() throws Exception { arp.hashCode(); arp1.hashCode(); arp2.hashCode(); Assert.assertNotEquals(0, arp.hashCode()); Assert.assertNotEquals(0,arp1.hashCode()); Assert.assertNotEquals(0,arp2.hashCode()); }