### Question:
BaseEditorSearchIndex implements EditorSearchIndex<T> { @Override public void close() { results = new ArrayList<>(); currentTerm = ""; currentResult = null; triggerOnSearchPerformedCommand(); triggerSearchClosedCommand(); }  @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();  }### Answer:
@Test public void testClose() { index.search("Element"); index.close(); assertEquals(0, index.getTotalOfResultsNumber()); assertEquals(0, index.getCurrentResultNumber()); assertEquals("", index.getCurrentTerm()); assertEquals(0, index.getResults().size()); verify(searchPerformedCallback, Mockito.times(2)).execute(); verify(searchClosedCallback).execute(); }