public static Deserializer<ICMP6> deserializer() {
        return (data, offset, length) -> {
            checkInput(data, offset, length, HEADER_LENGTH);

            ICMP6 icmp6 = new ICMP6();

            ByteBuffer bb = ByteBuffer.wrap(data, offset, length);

            icmp6.icmpType = bb.get();
            icmp6.icmpCode = bb.get();
            icmp6.checksum = bb.getShort();

            Deserializer<? extends IPacket> deserializer;
            if (ICMP6.TYPE_DESERIALIZER_MAP.containsKey(icmp6.icmpType)) {
                deserializer = TYPE_DESERIALIZER_MAP.get(icmp6.icmpType);
            } else {
                deserializer = Data.deserializer();
            }
            icmp6.payload = deserializer.deserialize(data, bb.position(),
                                                bb.limit() - bb.position());
            icmp6.payload.setParent(icmp6);

            return icmp6;
        };
    }
@Test
    public void testDeserializeTruncated() throws Exception {
        PacketTestUtils.testDeserializeTruncated(ICMP6.deserializer(), bytePacket);
    }