### Question:
TreeSaveIndex implements ISaveIndex { @Override public ResourceSaveIndexes getIndexes(String policyRule) { ResourceSaveIndexes legacyIndexes = legacySaveIndex.getIndexes(policyRule); policyRule = policyRule.toLowerCase(); Set<String> pathIndexes = new HashSet<String>(); pathIndexes.add(parsePolicyRule(policyRule)); return new ResourceSaveIndexes( legacyIndexes.getHostIndexes(), pathIndexes, legacyIndexes.getParentPathIndexes()); }  @Override ResourceSaveIndexes getIndexes(String policyRule);  }### Answer:
@Test public void simpleScenario() { ResourceSaveIndexes result = saveIndex.getIndexes("http: Set<String> expectedResults = new HashSet<String>(); expectedResults.add("http: assertEquals(Arrays.asList(": assertEquals(expectedResults, result.getPathIndexes()); assertEquals(Arrays.asList("/"), result.getParentPathIndexes()); }
@Test public void normaliseSpecialWildcards() { ResourceSaveIndexes result = saveIndex.getIndexes("http: Set<String> expectedResults = new HashSet<String>(); expectedResults.add("http: assertEquals(Arrays.asList(": assertEquals(expectedResults, result.getPathIndexes()); assertEquals(Arrays.asList("/"), result.getParentPathIndexes()); }
@Test public void enforceLowerCase() { ResourceSaveIndexes result = saveIndex.getIndexes("HtTp: Set<String> expectedResults = new HashSet<String>(); expectedResults.add("http: assertEquals(Arrays.asList(": assertEquals(expectedResults, result.getPathIndexes()); assertEquals(Arrays.asList("/"), result.getParentPathIndexes()); }