### Question:
DataTypeSearchBarView implements DataTypeSearchBar.View { List<DataTypeListItem> groupElementsWithItsParents(final List<DataTypeListItem> allElements) { final List<DataTypeListItem> groupedElements = getGroupedElementsList(); for (final DataTypeListItem item : allElements) { groupElementWithItsParent(groupedElements, allElements, item); } return groupedElements; } @Inject  DataTypeSearchBarView(final HTMLInputElement searchBar,
                                 final @Named("span") HTMLElement searchIcon,
                                 final HTMLButtonElement closeSearch,
                                 final TranslationService translationService); @PostConstruct void setupSearchBar(); @Override void init(final DataTypeSearchBar presenter); @EventHandler("close-search") void onSearchBarCloseButton(final ClickEvent e); @EventHandler("search-bar") void onSearchBarKeyUpEvent(final KeyUpEvent event); @EventHandler("search-bar") void onSearchBarKeyDownEvent(final KeyDownEvent e); @EventHandler("search-bar") void onSearchBarChangeEvent(final ChangeEvent e); @Override void resetSearchBar(); @Override void showSearchResults(final List<DataType> results); void refreshItemsPosition();  }### Answer:
@Test public void testGroupElementsWithItsParents() { final List<DataTypeListItem> groupedElementsList = mock(List.class); final DataTypeListItem element1 = mock(DataTypeListItem.class); final DataTypeListItem element2 = mock(DataTypeListItem.class); final List<DataTypeListItem> allElements = Arrays.asList(element1, element2); doReturn(groupedElementsList).when(view).getGroupedElementsList(); doNothing().when(view).groupElementWithItsParent(groupedElementsList, allElements, element1); doNothing().when(view).groupElementWithItsParent(groupedElementsList, allElements, element2); final List<DataTypeListItem> actual = view.groupElementsWithItsParents(allElements); verify(view).groupElementWithItsParent(groupedElementsList, allElements, element1); verify(view).groupElementWithItsParent(groupedElementsList, allElements, element2); assertEquals(actual, groupedElementsList); }