### Question:
LazyModuleLoader { public synchronized ActivityLike loadActivityModule( Activity activity, String moduleName, String className) throws LazyLoadingException { try { Class lazyLoadedClass = mLoaderAlgorithm.loadModule(moduleName, className); Constructor c = lazyLoadedClass.getConstructor(Activity.class); ActivityLike activityLike = (ActivityLike) c.newInstance(activity); return activityLike; } catch (Throwable t) { throw new LazyLoadingException(t); } } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmentLike loadSupportFragmentModule(
      Fragment hostingFragment, String moduleName, String className); synchronized FragmentLike loadFragmentModule(
      android.app.Fragment hostingFragment, String moduleName, String className); synchronized ActivityLike loadActivityModule(
      Activity activity, String moduleName, String className); synchronized Class loadModule(String moduleName, String className); synchronized void installModule(String moduleName);  }### Answer:
@Test public void testThatLoadSucceedsForActivityModule() throws IOException, LazyLoadingException, ClassNotFoundException { Mockito.when(mModulePathsNo1Mock.containsDexFile()).thenReturn(true); Mockito.when(mModulePathsNo1Mock.getDexFile()).thenReturn(mDexFileNo1Mock); Mockito.when(mModulePathsNo1Mock.getOptimizedDexFile()).thenReturn(mOptDexFileNo1Mock); ActivityLike returnedActivity = mObjectUnderTest.loadActivityModule( mActivityMock, MODULE_NAME_NO1, ActivityModule.class.getName()); Assert.assertEquals(returnedActivity.getClass(), ActivityModule.class); Mockito.verify(mCustomClassLoaderMock) .addDex(Mockito.eq(mDexFileNo1Mock), Mockito.eq(mOptDexFileNo1Mock)); Mockito.verify(mLazyLoadListenerMock) .moduleLazilyLoaded(Mockito.eq(MODULE_NAME_NO1), Mockito.anyLong()); Mockito.verify(mClassLoaderMock).loadClass(ActivityModule.class.getName()); Mockito.verifyZeroInteractions(mNativeModuleLoaderMock); }