### Question:
ComponentRewriteRuleServiceImpl implements ComponentRewriteRuleService { @Override public Set<String> getSlingResourceTypes(ResourceResolver resolver) throws RepositoryException { List<ComponentRewriteRule> rules = getRules(resolver); Set<String> types = new HashSet<>(rules.size()); for (ComponentRewriteRule r : rules) { types.addAll(r.getSlingResourceTypes()); } return types; }  @SuppressWarnings("unused") void bindRule(ComponentRewriteRule rule); @SuppressWarnings("unused") void unbindRule(ComponentRewriteRule rule); List<ComponentRewriteRule> getRules(ResourceResolver resolver); @Override Set<String> getSlingResourceTypes(ResourceResolver resolver); static final String RULES_SEARCH_PATH; }### Answer:
@Test public void testGetSlingResourceTypes() throws Exception { Set<String> resourceTypes = componentRewriteRuleService.getSlingResourceTypes(context.resourceResolver()); assertTrue(resourceTypes.contains("geometrixx/components/simple")); resourceTypes.remove("geometrixx/components/simple"); assertTrue(resourceTypes.contains("geometrixx/components/mapProperties")); resourceTypes.remove("geometrixx/components/mapProperties"); assertTrue(resourceTypes.contains("geometrixx/components/rewriteOptional")); resourceTypes.remove("geometrixx/components/rewriteOptional"); assertTrue(resourceTypes.contains("geometrixx/components/rewriteRanking")); resourceTypes.remove("geometrixx/components/rewriteRanking"); assertTrue(resourceTypes.contains("geometrixx/components/rewriteMapChildren")); resourceTypes.remove("geometrixx/components/rewriteMapChildren"); assertTrue(resourceTypes.contains("geometrixx/components/rewriteFinal")); resourceTypes.remove("geometrixx/components/rewriteFinal"); assertTrue(resourceTypes.contains("geometrixx/components/rewriteFinalOnReplacement")); resourceTypes.remove("geometrixx/components/rewriteFinalOnReplacement"); assertTrue(resourceTypes.contains("geometrixx/components/rewriteProperties")); resourceTypes.remove("geometrixx/components/rewriteProperties"); assertTrue(resourceTypes.contains("granite/ui/components/foundation/container")); resourceTypes.remove("granite/ui/components/foundation/container"); assertTrue(resourceTypes.isEmpty()); }