MacAddress { public static MacAddress broadcast() { if (broadcast == null) { byte[] pole = new byte[6]; for (int i = 0; i < 6; i++) { pole[i] = (byte) 255; } broadcast = new MacAddress(pole); } return broadcast; } MacAddress(String address);  MacAddress(String address, char delimiter);  MacAddress(byte[] representation); @Override String toString(); String getCiscoRepresentation(); byte [] getByteArray(); @Override boolean equals(Object obj); @Override int hashCode(); boolean isLessOrEqualThan(MacAddress other); static boolean isBroadcast(MacAddress mac); static MacAddress broadcast(); static MacAddress getRandomMac();  }
@Test public void testBroadcast() { MacAddress mac; String sm; sm="ff:ff:ff:ff:ff:ff"; mac = new MacAddress(sm); assertTrue(MacAddress.isBroadcast(mac)); sm="1a:4c:05:49:ad:f9"; mac = new MacAddress(sm); assertFalse(MacAddress.isBroadcast(mac)); }