@Test
public void t04_complexGrouping() throws Exception {

    String e1 = "(tagA and not tagB) and (not tagC or tagD)";
    assertEquals("and(and(tagA, not tagB), or(tagD, not tagC))", parser.parse(e1));
    String e2 = "(not tagB and tagA) and (not tagC or tagD)";
    assertEquals("and(and(tagA, not tagB), or(tagD, not tagC))", parser.parse(e2));
    String e3 = "(not tagA and (not tagB and tagC)) and tagD";
    assertEquals("and(tagD, and(and(tagC, not tagB), not tagA))", parser.parse(e3));
    String e4 = "((not tagA and (not tagB and tagC)) and tagD) and tagE";
    assertEquals("and(tagE, and(tagD, and(and(tagC, not tagB), not tagA)))", parser.parse(e4));
}