OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter,
                                                         OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler,
                                                         AppRatingSelected.AppRatingSelectedHandler,
                                                         AppRatingDeselected.AppRatingDeselectedHandler,
                                                         AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                                         DetailsHierarchyClicked.DetailsHierarchyClickedHandler,
                                                         DetailsCategoryClicked.DetailsCategoryClickedHandler { void getFilteredHierarchies(final OntologyHierarchy root, final Tree<OntologyHierarchy, String> tree) { serviceFacade.getFilteredHierarchies(root.getIri(), ontologyUtil.convertHierarchyToAvu(root), new AsyncCallback<OntologyHierarchy>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); tree.unmask(); } @Override public void onSuccess(OntologyHierarchy result) { if (result == null || result.getSubclasses() == null) { result = root; result.setSubclasses(Lists.<OntologyHierarchy>newArrayList()); } OntologyHierarchy unclassifiedChild = ontologyUtil.addUnclassifiedChild(result); unclassifiedHierarchies.add(unclassifiedChild); ontologyUtil.getOrCreateHierarchyPathTag(result); addHierarchies(tree.getStore(), null, result.getSubclasses()); tree.unmask(); } }); } @Inject  OntologyHierarchiesPresenterImpl(OntologyHierarchiesViewFactory viewFactory,
                                            OntologyServiceFacade serviceFacade,
                                            EventBus eventBus,
                                            OntologyHierarchiesView.OntologyHierarchiesAppearance appearance); @Override void go(final DETabPanel tabPanel); @Override void setViewDebugId(String baseID); @Override void onAppInfoSelected(final AppInfoSelectedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onOntologyHierarchySelectionChanged(OntologyHierarchySelectionChangedEvent event); @Override void onAppRatingDeselected(AppRatingDeselected event); @Override void onAppRatingSelected(AppRatingSelected event); @Override void onAppFavoriteSelected(AppFavoriteSelectedEvent event); @Override void onDetailsHierarchyClicked(DetailsHierarchyClicked event); @Override void onDetailsCategoryClicked(DetailsCategoryClicked event); @Override HandlerRegistration addOntologyHierarchySelectionChangedEventHandler(
            OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler handler);  }
@Test public void testGetFilteredHierarchies() { when(ontologyUtilMock.convertHierarchyToAvu(hierarchyMock)).thenReturn(avuMock); OntologyHierarchiesPresenterImpl spy = spy(uut); spy.getFilteredHierarchies(hierarchyMock, hierarchyTreeMock); verify(ontologyServiceMock).getFilteredHierarchies(anyString(), eq(avuMock), hierarchyCallback.capture()); hierarchyCallback.getValue().onSuccess(hierarchyMock); verify(ontologyUtilMock).addUnclassifiedChild(eq(hierarchyMock)); verify(unclassifiedHierarchiesMock).add(eq(unclassifiedMock)); verify(ontologyUtilMock).getOrCreateHierarchyPathTag(hierarchyMock); verify(spy).addHierarchies(eq(hierarchyTreeStoreMock), isNull(OntologyHierarchy.class), eq(hierarchyListMock)); verify(hierarchyTreeMock).unmask(); }