@Override
    public String toString() {
        return toStringHelper(getClass())
                .add("version", Byte.toString(version))
                .add("headerLength", Byte.toString(headerLength))
                .add("diffServ", Byte.toString(diffServ))
                .add("totalLength", Short.toString(totalLength))
                .add("identification", Short.toString(identification))
                .add("flags", Byte.toString(flags))
                .add("fragmentOffset", Short.toString(fragmentOffset))
                .add("ttl", Byte.toString(ttl))
                .add("protocol", Byte.toString(protocol))
                .add("checksum", Short.toString(checksum))
                .add("sourceAddress", Integer.toString(sourceAddress))
                .add("destinationAddress", Integer.toString(destinationAddress))
                .add("options", Arrays.toString(options))
                .add("isTruncated", Boolean.toString(isTruncated))
                .toString();
    }
@Test
    public void testToStringIPv4() throws Exception {
        IPv4 ipv4 = deserializer.deserialize(headerBytes, 0, headerBytes.length);
        String str = ipv4.toString();

        assertTrue(StringUtils.contains(str, "version=" + VERSION));
        assertTrue(StringUtils.contains(str, "headerLength=" + HEADER_LENGTH));
        assertTrue(StringUtils.contains(str, "diffServ=" + DIFF_SERV));
        assertTrue(StringUtils.contains(str, "totalLength=" + TOTAL_LENGTH));
        assertTrue(StringUtils.contains(str, "identification=" + IDENTIFICATION));
        assertTrue(StringUtils.contains(str, "flags=" + FLAGS));
        assertTrue(StringUtils.contains(str, "fragmentOffset=" + FRAGMENT_OFFSET));
        assertTrue(StringUtils.contains(str, "ttl=" + TTL));
        assertTrue(StringUtils.contains(str, "protocol=" + PROTOCOL));
        assertTrue(StringUtils.contains(str, "checksum=" + CHECKSUM));
        assertTrue(StringUtils.contains(str, "sourceAddress=" + SOURCE_ADDRESS));
        assertTrue(StringUtils.contains(str, "destinationAddress=" + DESTINATION_ADDRESS));
    }