### Question:
VirtualNetworkFilter implements IFloodlightModule, IVirtualNetworkService, IOFMessageListener { @Override public void addHost(MACAddress mac, String guid, String port) { if (guid != null) { if (log.isDebugEnabled()) { log.debug("Adding {} to network ID {} on port {}", new Object[] {mac, guid, port}); } macToGuid.put(mac, guid); portToMac.put(port, mac); if(vNetsByGuid.get(guid)!=null) vNetsByGuid.get(guid).addHost(new MACAddress(mac.toBytes())); } else { log.warn("Could not add MAC {} to network ID {} on port {}, the network does not exist", new Object[] {mac, guid, port}); } }  @Override void createNetwork(String guid, String network, Integer gateway); @Override void deleteNetwork(String guid); @Override void addHost(MACAddress mac, String guid, String port); @Override void deleteHost(MACAddress mac, String port); @Override Collection<Class<? extends IFloodlightService>> getModuleServices(); @Override Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls(); @Override Collection<Class<? extends IFloodlightService>> getModuleDependencies(); @Override void init(FloodlightModuleContext context); @Override void startUp(FloodlightModuleContext context); @Override String getName(); @Override boolean isCallbackOrderingPrereq(OFType type, String name); @Override boolean isCallbackOrderingPostreq(OFType type, String name); @Override Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx); @Override Collection <VirtualNetwork> listNetworks();  }### Answer:
@Test public void testAddHost() { testModifyNetwork(); vns.addHost(mac1, guid1, hostPort1); assertTrue(vns.macToGuid.get(mac1).equals(guid1)); assertTrue(vns.portToMac.get(hostPort1).equals(mac1)); assertTrue(vns.vNetsByGuid.get(guid1).hosts.contains(mac1)); vns.addHost(mac2, guid1, hostPort2); assertTrue(vns.macToGuid.get(mac2).equals(guid1)); assertTrue(vns.portToMac.get(hostPort2).equals(mac2)); assertTrue(vns.vNetsByGuid.get(guid1).hosts.contains(mac2)); vns.addHost(mac3, guid3, hostPort3); vns.addHost(mac4, guid3, hostPort4); assertTrue(vns.vNetsByGuid.get(guid3).hosts.contains(mac4)); }