@Test
public void testCreateInstance() throws Exception {

      // configure mocks
      DependencyResolver dependencyResolver = mock(DependencyResolver.class);
      BindingAwareBroker broker = mock(BindingAwareBroker.class);
      when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
      // create instance of module with injected mocks
      Onem2mSimpleAdapterModule module = new Onem2mSimpleAdapterModule(mock(ModuleIdentifier.class), dependencyResolver);
      // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
      AutoCloseable closeable = module.getInstance();
      // verify that the module registered the returned provider with the broker
      verify(broker).registerProvider((Onem2mSimpleAdapterProvider)closeable);
      // ensure no exceptions on close
      closeable.close();
}