CategoryPredicate extends PropertyPredicate implements BasePredicate { @Override public void accept(PredicateVisitor visitor) { visitor.acceptCategoryPredicate(this); } CategoryPredicate(String propertyId); @Override void accept(PredicateVisitor visitor);  }
@Test public void testAccept() { String propertyId = PropertyHelper.getPropertyId("category1", "foo"); TestCategoryPredicate predicate = new TestCategoryPredicate(propertyId); TestPredicateVisitor visitor = new TestPredicateVisitor(); predicate.accept(visitor); Assert.assertSame(predicate, visitor.visitedCategoryPredicate); }