SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeListener<IrdConfigurationEntry> { @Override public synchronized void close() throws Exception { try { if (listenerReg != null) { listenerReg.close(); } } catch (Exception e) { LOG.info("Error while closing the registration"); } LOG.info("SimpleIrdEntryListener closed"); } SimpleIrdEntryListener(InstanceIdentifier<Resource> instance, Uuid entryContext); void register(DataBroker dataBroker, InstanceIdentifier<IrdConfigurationEntry> iid); @Override synchronized void onDataTreeChanged(Collection<DataTreeModification<IrdConfigurationEntry>> changes); @Override synchronized void close();  }
@Test public void close() throws Exception { simpleIrdEntryListener.close(); verify(m_reg).close(); }