}
public void testOverlapFilter() throws IOException {
final Category category = new Category("test category");
final List<Element> elements1 = Arrays.asList(new Element("one", true, false, false));
final PatternRule rule1 = new PatternRule("id1", new English(), elements1, "desc1", "msg1", "shortMsg1");
rule1.setSubId("1");
rule1.setCategory(category);
final List<Element> elements2 = Arrays.asList(new Element("one", true, false, false), new Element("two", true, false, false));
final PatternRule rule2 = new PatternRule("id1", new English(), elements2, "desc2", "msg2", "shortMsg2");
rule2.setSubId("2");
rule2.setCategory(category);
final JLanguageTool tool = new JLanguageTool(new English());
tool.addRule(rule1);
tool.addRule(rule2);
final List<RuleMatch> ruleMatches1 = tool.check("And one two three.");
assertEquals("one overlapping rule must be filtered out", 1, ruleMatches1.size());