DeviceCRUDListener implements DeviceStateProvider { public void destroy() { m_deviceManager.removeDeviceStateProvider(this); } DeviceCRUDListener(DeviceManager deviceManager, PmaRegistryImpl pmaRegistry); void init(); void destroy(); @Override void deviceAdded(String deviceName); @Override void deviceRemoved(String deviceName);  }
@Test public void testDestroyUnregisters() { verifyZeroInteractions(m_deviceManager); m_listener.destroy(); verify(m_deviceManager).removeDeviceStateProvider(m_listener); }