@Test
public void testDecode_IPv4EtherType() throws Exception {

    byte[] packet = {
        0x01, 0x23, 0x45, 0x67, (byte) 0x89, (byte) 0xab,
        (byte) 0xcd, (byte) 0xef, 0x01, 0x23, 0x45, 0x67,
        0x08, 0x00,
        0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11,
        (byte)0x98, (byte)0xfe, (byte)0xdc, (byte)0xba
    };
    NotificationProviderService mock = Mockito.mock(NotificationProviderService.class);
    EthernetPacketReceived notification = new EthernetDecoder(mock)
            .decode(new PacketReceivedBuilder().setPayload(packet).setMatch(new MatchBuilder().build()).build());
    EthernetPacket ethernetPacket = (EthernetPacket) notification.getPacketChain().get(1).getPacket();
    assertEquals(ethernetPacket.getEthertype(), KnownEtherType.Ipv4);
    assertNull(ethernetPacket.getEthernetLength());
    assertNull(ethernetPacket.getHeader8021q());
    assertEquals(ethernetPacket.getDestinationMac().getValue(), "01:23:45:67:89:ab");
    assertEquals(ethernetPacket.getSourceMac().getValue(), "cd:ef:01:23:45:67");
    assertEquals(14, ethernetPacket.getPayloadOffset().intValue());
    assertEquals(14, ethernetPacket.getPayloadLength().intValue());
    assertEquals(2566839482L, ethernetPacket.getCrc().longValue());
    assertTrue(Arrays.equals(packet, notification.getPayload()));
}