### Question:
StructureRewriteRuleServiceImpl implements StructureRewriteRuleService { @Override public List<StructureRewriteRule> getRules(ResourceResolver resolver) { List<StructureRewriteRule> rulesCopy = new LinkedList<>(); Iterator<StructureRewriteRule> it = rules.iterator(); while (it.hasNext()) { rulesCopy.add(it.next()); } return rulesCopy; }  @SuppressWarnings("unused") void bindRule(StructureRewriteRule rule); @SuppressWarnings("unused") void unbindRule(StructureRewriteRule rule); @SuppressWarnings("unused") void bindPageRule(PageStructureRewriteRule rule); @SuppressWarnings("unused") void unbindPageRule(PageStructureRewriteRule rule); @Override Set<String> getTemplates(); @Override List<StructureRewriteRule> getRules(ResourceResolver resolver);  }### Answer:
@Test public void testGetRules() throws Exception { List<StructureRewriteRule> rules = structureRewriteRuleService.getRules(null); assertNotNull(rules); assertFalse(rules.isEmpty()); assertEquals(4, rules.size()); Iterator<StructureRewriteRule> it = rules.iterator(); StructureRewriteRule rule = it.next(); assertTrue(rule instanceof PageStructureRewriteRule); rule = it.next(); assertTrue(rule instanceof PageStructureRewriteRule); rule = it.next(); assertTrue(rule instanceof ParsysRewriteRule); rule = it.next(); assertTrue(rule instanceof ColumnControlRewriteRule); }