### Question:
MacUtils { public static byte[] getOverride() { String overrideMac = System.getProperty(OVERRIDE_MAC_PROP); byte[] macBytes = null; if (overrideMac != null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); String[] rawBytes = overrideMac.split(":"); if (rawBytes.length == 6) { try { for (String b : rawBytes) { out.write(Integer.parseInt(b, 16)); } macBytes = out.toByteArray(); } catch (NumberFormatException e) { } } } return macBytes; }  static byte[] getOverride(); static byte[] realMacAddress(); static byte[] macAddress(); static final String OVERRIDE_MAC_PROP; }### Answer:
@Test public void bogusOverride() { System.setProperty(MacUtils.OVERRIDE_MAC_PROP, "totally not a MAC"); byte[] mac = MacUtils.getOverride(); Assert.assertNull("Retrieved a bogus MAC", mac); System.clearProperty(MacUtils.OVERRIDE_MAC_PROP); }
@Test public void slightlyBogusOverride() { System.setProperty(MacUtils.OVERRIDE_MAC_PROP, "00:DE:AD:BE:EF:QQ"); byte[] mac = MacUtils.getOverride(); Assert.assertNull("Retrieved a bogus MAC", mac); System.clearProperty(MacUtils.OVERRIDE_MAC_PROP); }