Onem2mbenchmarkModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.onem2mbenchmark.impl.rev141210.AbstractOnem2mbenchmarkModule { @Override public java.lang.AutoCloseable createInstance() { Onem2mbenchmarkProvider provider = new Onem2mbenchmarkProvider(); getBrokerDependency().registerProvider(provider); return provider; } Onem2mbenchmarkModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver);  Onem2mbenchmarkModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.onem2mbenchmark.impl.rev141210.Onem2mbenchmarkModule oldModule, java.lang.AutoCloseable oldInstance); @Override void customValidation(); @Override java.lang.AutoCloseable createInstance();  }
@Test public void testCreateInstance() throws Exception { DependencyResolver dependencyResolver = mock(DependencyResolver.class); BindingAwareBroker broker = mock(BindingAwareBroker.class); when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker); Onem2mbenchmarkModule module = new Onem2mbenchmarkModule(mock(ModuleIdentifier.class), dependencyResolver); AutoCloseable closeable = module.getInstance(); verify(broker).registerProvider((Onem2mbenchmarkProvider)closeable); closeable.close(); }