### Question:
Arp extends Packet { @Override public Packet deserialize(byte[] data, int bitOffset, int size) throws PacketException { return super.deserialize(data, bitOffset, size); } Arp(); Pair<Integer, Integer> setSHAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setSPAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setTHAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setTPAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); @Override Packet deserialize(byte[] data, int bitOffset, int size); @Override byte[] serialize(); @Override int getfieldnumBits(String fieldName); Arp setHardwareType(int value); Arp setProtocolType(int value); Arp setHardwareLength(short value); Arp setProtocolLength(short value); Arp setOperation(int value); Arp setSenderHardwareAddress(byte[] value); Arp setSenderProtocolAddress(byte[] value); Arp setTargetHardwareAddress(byte[] value); Arp setTargetProtocolAddress(byte[] value); int getHardwareType(); int getProtocolType(); short getHardwareLength(); short getProtocolLength(); int getOperation(); byte[] getSenderHardwareAddress(); byte[] getSenderProtocolAddress(); byte[] getTargetHardwareAddress(); byte[] getTargetProtocolAddress();  }### Answer:
@Test public void deserializeTest() throws PacketException { byte[] output = arp.serialize(); Packet packet = arp.deserialize(output, 0, 28); Assert.assertTrue(packet instanceof Arp); Arp newArp = (Arp) packet; Assert.assertArrayEquals(sha, newArp.getSenderHardwareAddress()); Assert.assertArrayEquals(tha, newArp.getTargetHardwareAddress()); Assert.assertArrayEquals(spa, newArp.getSenderProtocolAddress()); Assert.assertArrayEquals(tpa, newArp.getTargetProtocolAddress()); Assert.assertEquals(operation, newArp.getOperation()); Assert.assertEquals(hlen, newArp.getHardwareLength()); Assert.assertEquals(plen, newArp.getProtocolLength()); Assert.assertEquals(htype, newArp.getHardwareType()); Assert.assertEquals(ptype, newArp.getProtocolType()); }