### Question:
OcsInterfaceUtils extends InterfaceUtils { public Network selectManagementNetworkWhiteAndBlackOnly(Computer computer) { List<Network> possibleNetworks = new ArrayList<>(); for (Network network : computer.getNetworks()) { if (!network.getIPAddress().isEmpty()) { if (isIpWhiteListed(network.getIPAddress()) && !isIpBlackListed(network.getIPAddress())) { possibleNetworks.add(network); } } else { LOGGER.debug("FOUND A NETWORK WITHOUT IPADDRESS FOR COMPUTER ID:{} NAME:{}", computer.getHardware().getId(), computer.getHardware().getName()); } } if (possibleNetworks.size() >= 1) { return possibleNetworks.get(0); } else { String ocsPickedIp = computer.getHardware().getIpaddr(); if (!ocsPickedIp.isEmpty()) { if (isIpWhiteListed(ocsPickedIp) && !isIpBlackListed(ocsPickedIp)) { Network fakeNetwork = new Network(); fakeNetwork.setIPAddress(ocsPickedIp); return fakeNetwork; } else { return null; } } else { LOGGER.debug("FALL BACK TO OCS PICKED IP BUT IP WAS EMPTY FOR COMPUTER ID:{} NAME:{}", computer.getHardware().getId(), computer.getHardware().getName()); return null; } } } OcsInterfaceUtils(final InstanceConfiguration config); Network selectManagementNetworkWhiteAndBlackOnly(Computer computer); String selectIpAddressWhiteAndBlackOnly(SnmpDevice snmpDevice); String selectIpAddress(SnmpDevice snmpDevice); Network selectManagementNetwork(Computer computer); List<RequisitionCategory> populateCategories(Computer myComputer, InstanceConfiguration config, String instance); List<RequisitionAsset> populateAssets(Computer myComputer, InstanceConfiguration config, String instance);  }### Answer:
@Test public void selectManagementNetworkWhiteAndBlackOnlyTest() { assertNotNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerWhite)); assertEquals(IP_WHITE, helper.selectManagementNetworkWhiteAndBlackOnly(computerWhite).getIPAddress()); assertNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerDefault)); assertNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerBlack)); assertNotNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerDefaultWhite)); assertEquals(IP_WHITE, helper.selectManagementNetworkWhiteAndBlackOnly(computerDefaultWhite).getIPAddress()); assertNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerDefaultBlack)); assertNotNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerBlackWhite)); assertEquals(IP_WHITE, helper.selectManagementNetworkWhiteAndBlackOnly(computerBlackWhite).getIPAddress()); assertNotNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerDefaultBlackWhite)); assertEquals(IP_WHITE, helper.selectManagementNetworkWhiteAndBlackOnly(computerDefaultBlackWhite).getIPAddress()); }