@Test public void testNextResult() { index.search("Element"); times(4, () -> index.nextResult()); final InOrder inOrder = Mockito.inOrder(searchable1, searchable2, searchable3, searchable4); inOrder.verify(searchable1).onFound(); inOrder.verify(searchable2).onFound(); inOrder.verify(searchable3).onFound(); inOrder.verify(searchable4).onFound(); inOrder.verify(searchable1).onFound(); inOrder.verifyNoMoreInteractions(); verify(noResultsFoundCallback, never()).execute(); verify(searchPerformedCallback, Mockito.times(5)).execute(); }
@Override public void nextResult() { final Optional<T> result = findNextElement(); currentResult = result.orElse(null); triggerOnFoundCommand(); triggerOnSearchPerformedCommand(); }
BaseEditorSearchIndex implements EditorSearchIndex<T> { @Override public void nextResult() { final Optional<T> result = findNextElement(); currentResult = result.orElse(null); triggerOnFoundCommand(); triggerOnSearchPerformedCommand(); } }
BaseEditorSearchIndex implements EditorSearchIndex<T> { @Override public void nextResult() { final Optional<T> result = findNextElement(); currentResult = result.orElse(null); triggerOnFoundCommand(); triggerOnSearchPerformedCommand(); }  }
BaseEditorSearchIndex implements EditorSearchIndex<T> { @Override public void nextResult() { final Optional<T> result = findNextElement(); currentResult = result.orElse(null); triggerOnFoundCommand(); triggerOnSearchPerformedCommand(); }  @Override void setSearchPerformedCallback(final Command searchPerformedCallback); @Override List<HasSearchableElements<T>> getSubIndexes(); @Override void registerSubIndex(final HasSearchableElements<T> hasSearchableElements); @Override void search(final String term); @Override int getCurrentResultNumber(); @Override int getTotalOfResultsNumber(); @Override void close(); @Override void setNoResultsFoundCallback(final Command callback); @Override void setClearCurrentResultsCallback(final Command callback); @Override void setSearchClosedCallback(final Command searchClosedCallback); @Override boolean isDirty(); @Override void nextResult(); @Override void previousResult(); @Override Integer getCurrentAssetHashcode(); void setCurrentAssetHashcodeSupplier(final Supplier<Integer> currentAssetHashcodeSupplier); @Override Optional<T> getCurrentResult(); }
BaseEditorSearchIndex implements EditorSearchIndex<T> { @Override public void nextResult() { final Optional<T> result = findNextElement(); currentResult = result.orElse(null); triggerOnFoundCommand(); triggerOnSearchPerformedCommand(); }  @Override void setSearchPerformedCallback(final Command searchPerformedCallback); @Override List<HasSearchableElements<T>> getSubIndexes(); @Override void registerSubIndex(final HasSearchableElements<T> hasSearchableElements); @Override void search(final String term); @Override int getCurrentResultNumber(); @Override int getTotalOfResultsNumber(); @Override void close(); @Override void setNoResultsFoundCallback(final Command callback); @Override void setClearCurrentResultsCallback(final Command callback); @Override void setSearchClosedCallback(final Command searchClosedCallback); @Override boolean isDirty(); @Override void nextResult(); @Override void previousResult(); @Override Integer getCurrentAssetHashcode(); void setCurrentAssetHashcodeSupplier(final Supplier<Integer> currentAssetHashcodeSupplier); @Override Optional<T> getCurrentResult();  }