public int toInt() {
        ByteBuffer bb = ByteBuffer.wrap(super.toOctets());
        return bb.getInt();
    }
@Test
    public void testToInt() {
        Ip4Address ipAddress;

        ipAddress = Ip4Address.valueOf("1.2.3.4");
        assertThat(ipAddress.toInt(), is(0x01020304));

        ipAddress = Ip4Address.valueOf("0.0.0.0");
        assertThat(ipAddress.toInt(), is(0));

        ipAddress = Ip4Address.valueOf("255.255.255.255");
        assertThat(ipAddress.toInt(), is(-1));
    }