AppFormerJsActivityLoader implements PlaceManagerImpl.AppFormerActivityLoader { public void init(final String gwtModuleName) { this.gwtModuleName = gwtModuleName; stream(appFormerComponentsRegistry.keys()) .map(this::newRegistryEntry) .forEach(this::registerComponent); } @Inject  AppFormerJsActivityLoader(final Promises promises,
                                     final ActivityManager activityManager,
                                     final ActivityBeansCache activityBeansCache,
                                     final PlaceManager placeManager,
                                     final LazyLoadingScreen lazyLoadingScreen,
                                     final Event<ActivityLazyLoaded> activityLazyLoadedEvent,
                                     final @Shadowed Instance<JsWorkbenchEditorActivity> jsWorkbenchEditorActivityInstance,
                                     final AppFormerComponentsRegistry appFormerComponentsRegistry); void init(final String gwtModuleName); void onComponentLoaded(final Object jsObject); native String extractComponentId(final Object object); boolean triggerLoadOfMatchingEditors(final Path path,
                                                final Runnable successCallback);  }
@Test public void init() { doReturn(new String[]{"foo", "bar"}).when(appFormerComponentsRegistry).keys(); doReturn(mock(JavaScriptObject.class)).when(appFormerComponentsRegistry).get(anyString()); doNothing().when(appFormerJsActivityLoader).registerComponent(any()); appFormerJsActivityLoader.init("my-module"); verify(appFormerJsActivityLoader, times(2)).registerComponent(any()); }