Mockito.when(context.getBundle()).thenReturn(bundle);
ComponentFactory factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
Mockito.when(factory.getBundleClassLoader()).thenReturn(Dependency.class.getClassLoader());
InstanceManager im = (InstanceManager) Mockito.mock(InstanceManager.class);
Mockito.when(im.getContext()).thenReturn(context);
Mockito.when(im.getFactory()).thenReturn(factory);
DependencyHandler handler = (DependencyHandler) Mockito.mock(DependencyHandler.class);
Mockito.when(handler.getInstanceManager()).thenReturn(im);
Logger logger = new Logger(context, "test", Logger.INFO);