### Question:
RuleList extends ArrayList<Rule> { public RuleList select(RuleVisitor visitor) { RuleList match = new RuleList(); for (Rule r : this) { if (visitor.visit(r)) { match.add(r); } } return match; } RuleList();  RuleList(List<Rule> rules); Rule first(); Rule collapse(); RuleList select(RuleVisitor visitor); RuleList select(SelectorVisitor visitor); RuleList selectById(final String id, final boolean wildcard); RuleList selectByName(final String name, final boolean wildcard, final boolean matchCase); RuleList match(Feature feature); RuleList flatten(); List<RuleList> zgroup(); Set<String> fields();  }### Answer:
@Test public void testSelect() { Style style = new StyleBuilder() .rule().select("Map").set("background-color", "white").endRule() .rule().select("#widgets").filter("cost > 10").set("line-color", "#123").endRule() .style(); RuleList rules = style.getRules(); assertEquals(2, rules.size()); assertEquals(1, rules.selectByName("Map", false, true).size()); assertEquals(1, rules.selectByName("Map", false, false).size()); assertEquals(0, rules.selectByName("map", false, true).size()); assertEquals(1, rules.selectByName("map", false, false).size()); assertEquals(1, rules.selectById("widgets", false).size()); }