BwFetchingService implements DataTreeChangeListener<NodeConnector> { public void addListeningPort(String portId) { if (!this.statisticData.containsKey(portId)) { statisticData.put(portId, new Statistic()); LOG.debug("Add listening port: {}", portId); } else { LOG.debug("Try to add existent 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 testAddListeningPort() throws Exception { service.addListeningPort("testPort1"); service.addListeningPort("testPort1"); }