public void testInet4Network() throws UnknownHostException {
// Test with null parameter.
address = InetAddress.getByAddress(getBytesFromAddress("127.0.0.1"));
try {
network4 = new Inet4Network(address, null);
assertTrue(false);
} catch (NullPointerException e) {
assertTrue(true);
}
// Test IP V4.
address = InetAddress.getByAddress(getBytesFromAddress("127.0.0.1"));
subnetmask4 = InetAddress.getByAddress(getBytesFromAddress("255.255.255.0"));
network4 = new Inet4Network(address, subnetmask4);
assertEquals("127.0.0.0/255.255.255.0", network4.toString());
}