### Question:
DMNEditorSearchIndex extends BaseEditorSearchIndex<DMNSearchableElement> { @Override protected List<DMNSearchableElement> getSearchableElements() { return getSubIndex().getSearchableElements(); } @Inject  DMNEditorSearchIndex(final DMNGraphSubIndex graphSubIndex,
                                final DMNGridSubIndex gridSubIndex,
                                final DMNDataTypesSubIndex dataTypesSubIndex,
                                final SessionManager sessionManager,
                                final Event<SearchPerformedEvent> searchPerformedEvent); @PostConstruct void init(); void setIsDataTypesTabActiveSupplier(final Supplier<Boolean> isDataTypesTabActiveSupplier); Supplier<Boolean> getIsDataTypesTabActiveSupplier();  }### Answer:
@Test public void testGetSearchableElementsWhenExpressionEditorIsActive() { when(expressionEditor.isActive()).thenReturn(true); when(gridSubIndex.getSearchableElements()).thenReturn(expectedElements); when(graphSubIndex.getSearchableElements()).thenReturn(emptyList()); final List<DMNSearchableElement> actualElements = searchIndex.getSearchableElements(); assertEquals(expectedElements, actualElements); }
@Test public void testGetSearchableElementsWhenExpressionEditorIsNotActive() { when(expressionEditor.isActive()).thenReturn(false); when(gridSubIndex.getSearchableElements()).thenReturn(emptyList()); when(graphSubIndex.getSearchableElements()).thenReturn(expectedElements); final List<DMNSearchableElement> actualElements = searchIndex.getSearchableElements(); assertEquals(expectedElements, actualElements); }