### Question:
SearchBarComponent { void updateViewNumber() { final int currentResultNumber = editorSearchIndex().map(EditorSearchIndex::getCurrentResultNumber).orElse(0); final int totalOfResultsNumber = editorSearchIndex().map(EditorSearchIndex::getTotalOfResultsNumber).orElse(0); view.setCurrentResultNumber(currentResultNumber); view.setTotalOfResultsNumber(totalOfResultsNumber); } @Inject  SearchBarComponent(final View view); void init(final EditorSearchIndex<T> editorSearchIndex); View getView(); void disableSearch();  }### Answer:
@Test public void testUpdateViewNumber() { final int currentResultNumber = 2; final int totalOfResultsNumber = 4; when(index.getCurrentResultNumber()).thenReturn(currentResultNumber); when(index.getTotalOfResultsNumber()).thenReturn(totalOfResultsNumber); component.updateViewNumber(); verify(view).setCurrentResultNumber(currentResultNumber); verify(view).setTotalOfResultsNumber(totalOfResultsNumber); }