@Test
public void testDecode_ReplyIPv4() throws Exception {

    byte[] packet = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Offset is 8
        0x00, 0x01, // Hardware Type -- Ethernet
        0x08, 0x00, // Protocol Type -- Ipv4
        0x06, // Hardware Length -- 6
        0x04, // Protcool Length -- 4
        0x00, 0x02, // Operator -- Reply
        0x01, 0x23, 0x45, 0x67, (byte) 0x89, (byte) 0xab, // Src Hardware Address
        (byte)0xc0, (byte)0xa8, 0x00, 0x01, // Src Protocol Address
        (byte) 0xcd, (byte) 0xef, 0x01, 0x23, 0x45, 0x67, // Dest Hardware Address
        0x01, 0x02, 0x03, 0x04 // Dest Protocol Address
    };
    NotificationProviderService mock = Mockito.mock(NotificationProviderService.class);
    ArrayList<PacketChain> packetChainList = new ArrayList<>();
    packetChainList.add(new PacketChainBuilder().setPacket(new RawPacketBuilder().build()).build());
    packetChainList.add(new PacketChainBuilder()
            .setPacket(new EthernetPacketBuilder().setPayloadOffset(8).setPayloadLength(36).build()).build());
    ArpPacketReceived notification = new ArpDecoder(mock)
            .decode(new EthernetPacketReceivedBuilder().setPacketChain(packetChainList).setPayload(packet).build());
    ArpPacket arpPacket = (ArpPacket) notification.getPacketChain().get(2).getPacket();
    assertEquals(KnownHardwareType.Ethernet, arpPacket.getHardwareType());
    assertEquals(KnownEtherType.Ipv4, arpPacket.getProtocolType());
    assertEquals(6, arpPacket.getHardwareLength().intValue());
    assertEquals(4, arpPacket.getProtocolLength().intValue());
    assertEquals(KnownOperation.Reply, arpPacket.getOperation());
    assertEquals("01:23:45:67:89:ab", arpPacket.getSourceHardwareAddress());
    assertEquals("192.168.0.1", arpPacket.getSourceProtocolAddress());
    assertEquals("cd:ef:01:23:45:67", arpPacket.getDestinationHardwareAddress());
    assertEquals("1.2.3.4", arpPacket.getDestinationProtocolAddress());
}