String string = "?!Foo(a, b) : !c";
RelationsEnvironment env = new RelationsEnvironment();
env.addRelation(new Relation("Foo", new String[] {"Bar", "Baz"}));
FPLParser parser = new FPLParser(string, env, new StubIType());
Predicate pred = parser.expression();
Assert.assertTrue("Parsed predicate should be a TestPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof TestPredicate);
TestPredicate val = (TestPredicate)pred;
Assert.assertTrue("Parsed predicate should be negative", !val.isPositive());
Assert.assertTrue("Parsed inner predicate should be negative", !val.getRelationship().isPositive());
Assert.assertEquals("Inner relationship incorrect", "Foo", val.getRelationship().getRelation().getName());