NotCriterion extends AbstractCriterion { @Override public String value() { return "(!" + criterion.value() + ')'; } NotCriterion(Criterion criterion); @Override String value();  }
@Test public void testCriterion() throws Exception { NotCriterion criterion = new NotCriterion(new RawCriterion("(|(a=b)(c=d))")); assertThat(criterion.value(), equalTo("(!(|(a=b)(c=d)))")); assertThat(criterion.filter(), notNullValue()); }