### Question:
TreeSearchIndex implements ISearchIndex { @Override public ResourceSearchIndexes getIndexes(String resource, String realm) throws EntitlementException { return DELEGATE.getIndexes(resource, realm); }  @Override ResourceSearchIndexes getIndexes(String resource, String realm);  }### Answer:
@Test public void simpleScenario() throws Exception { Set<String> indexes = new HashSet<String>(); indexes.add("some-test-index-1"); indexes.add("some-test-index-2"); when(treeService.searchTree("http: ResourceSearchIndexes result = searchIndex.getIndexes("http: assertEquals(asSet(": assertEquals(indexes, result.getPathIndexes()); assertEquals(asSet("/"), result.getParentPathIndexes()); verify(treeService).searchTree("http: }
@Test public void enforceLowerCase() throws Exception { searchIndex.getIndexes("HtTp: verify(treeService).searchTree("http: }
@Test public void parseRetrievedIndexes() throws Exception { Set<String> indexes = new HashSet<String>(); indexes.add("a-b-*-d-e"); indexes.add("a-*-c-*-e"); when(treeService.searchTree("http: ResourceSearchIndexes result = searchIndex.getIndexes("http: Set<String> parsedIndexes = new HashSet<String>(); parsedIndexes.add("a-b-*-d-e"); parsedIndexes.add("a-*-c-*-e"); assertEquals(asSet(": assertEquals(parsedIndexes, result.getPathIndexes()); assertEquals(asSet("/"), result.getParentPathIndexes()); verify(treeService).searchTree("http: }
@Test public void simpleScenario() throws Exception { Set<String> indexes = new HashSet<String>(); indexes.add("some-test-index-1"); indexes.add("some-test-index-2"); when(treeService.searchTree("http: ResourceSearchIndexes result = searchIndex.getIndexes("http: assertEquals(Arrays.asList(": assertEquals(indexes, result.getPathIndexes()); assertEquals(Arrays.asList("/"), result.getParentPathIndexes()); verify(treeService).searchTree("http: }
@Test public void parseRetrievedIndexes() throws Exception { Set<String> indexes = new HashSet<String>(); indexes.add("a-b-*-d-e"); indexes.add("a-*-c-*-e"); when(treeService.searchTree("http: ResourceSearchIndexes result = searchIndex.getIndexes("http: Set<String> parsedIndexes = new HashSet<String>(); parsedIndexes.add("a-b-*-d-e"); parsedIndexes.add("a-*-c-*-e"); assertEquals(Arrays.asList(": assertEquals(parsedIndexes, result.getPathIndexes()); assertEquals(Arrays.asList("/"), result.getParentPathIndexes()); verify(treeService).searchTree("http: }