SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<IrdInstanceConfiguration> { @Override public synchronized void close() throws Exception { try { if (mReg != null) { mReg.close(); } } catch (Exception e) { LOG.info("Error while closing the registration", e); } try { for (SimpleIrdEntryListener listener: mListeners.values()) { listener.close(); } mListeners.clear(); } catch (Exception e) { LOG.info("Error while closing the registration", e); } LOG.info("SimpleIrdListener closed"); } SimpleIrdListener(Uuid context); void register(DataBroker dataBroker, InstanceIdentifier<IrdInstanceConfiguration> iid); @Override synchronized void onDataTreeChanged(Collection<DataTreeModification<IrdInstanceConfiguration>> changes); @Override synchronized void close();  }
@Test public void close() throws Exception { simpleIrdListener.close(); verify(m_reg).close(); }