MACTools { public static boolean isValidMACAddress(final String macAddress) { return macAddress != null && PATTERN_MAC.matcher(macAddress).matches(); } private  MACTools(); static boolean isValidMACAddress(final String macAddress); static byte[] getMacBytes(String macStr);  }
@Test public void testValidMACAddresses() { for (String macAddress : getValidMACAddresses()) { assertTrue(MACTools.isValidMACAddress(macAddress)); } }
@Test public void testInvalidMACAddresses() { for (String macAddress: getInvalidMACAddresses()) { assertFalse(MACTools.isValidMACAddress(macAddress)); } }