BwFetchingService implements DataTreeChangeListener<NodeConnector> { public void removeListeningPort(String portId) { if (this.statisticData.containsKey(portId)) { statisticData.remove(portId); LOG.debug("Remove listening port: {}", portId); } else { LOG.debug("Try to remove nonexistent listening port: {}", portId); } } BwFetchingService(DataBroker dataBroker); @Override void onDataTreeChanged(@Nonnull Collection<DataTreeModification<NodeConnector>> changes); void addListeningPort(String portId); void removeListeningPort(String portId); void close();  }
@Test public void testRemoveListeningPort() throws Exception { service.addListeningPort("testPort2"); service.removeListeningPort("testPort2"); service.removeListeningPort("testPort2"); }