@Test public void testIsSameAddressAs() { Assert.assertTrue("1 and one should be considdered the same address", new Ip4Address(1L, 5L).isSameAddressAs("0.0.0.1")); Assert.assertFalse("zero and 0L should be considdered the same address but a Long won't be accepted", new Ip4Address("0.0.0.0", "00:00:00:00:00:08").isSameAddressAs(0L)); }
public boolean isSameAddressAs(final Object other) { if (other instanceof String) { return _addr.equals(other); } else { return equals(other); } }
Ip4Address { public boolean isSameAddressAs(final Object other) { if (other instanceof String) { return _addr.equals(other); } else { return equals(other); } } }
Ip4Address { public boolean isSameAddressAs(final Object other) { if (other instanceof String) { return _addr.equals(other); } else { return equals(other); } } Ip4Address(final long addr, final long mac);  Ip4Address(final String addr);  Ip4Address(final String addr, final String mac);  Ip4Address(final long addr); }
Ip4Address { public boolean isSameAddressAs(final Object other) { if (other instanceof String) { return _addr.equals(other); } else { return equals(other); } } Ip4Address(final long addr, final long mac);  Ip4Address(final String addr);  Ip4Address(final String addr, final String mac);  Ip4Address(final long addr); String ip4(); String mac(); long toLong(); boolean isSameAddressAs(final Object other); @Override int hashCode(); @Override boolean equals(final Object that); }
Ip4Address { public boolean isSameAddressAs(final Object other) { if (other instanceof String) { return _addr.equals(other); } else { return equals(other); } } Ip4Address(final long addr, final long mac);  Ip4Address(final String addr);  Ip4Address(final String addr, final String mac);  Ip4Address(final long addr); String ip4(); String mac(); long toLong(); boolean isSameAddressAs(final Object other); @Override int hashCode(); @Override boolean equals(final Object that);  }