PropertyPredicateVisitor implements PredicateVisitor { public Map<String, Object> getProperties() { return properties; }  @Override void acceptComparisonPredicate(ComparisonPredicate predicate); @Override void acceptArrayPredicate(ArrayPredicate predicate); @Override void acceptUnaryPredicate(UnaryPredicate predicate); @Override void acceptAlwaysPredicate(AlwaysPredicate predicate); @Override void acceptCategoryPredicate(CategoryPredicate predicate); Map<String, Object> getProperties();  }
@Test public void testVisit() { PropertyPredicateVisitor visitor = new PropertyPredicateVisitor(); PredicateHelper.visit(PREDICATE_1, visitor); Map<String, Object> properties = visitor.getProperties(); Assert.assertEquals(1, properties.size()); Assert.assertEquals("Monkey", properties.get(PROPERTY_A)); visitor = new PropertyPredicateVisitor(); PredicateHelper.visit(PREDICATE_3, visitor); properties = visitor.getProperties(); Assert.assertEquals(2, properties.size()); Assert.assertEquals("Monkey", properties.get(PROPERTY_A)); Assert.assertEquals("Runner", properties.get(PROPERTY_B)); visitor = new PropertyPredicateVisitor(); PredicateHelper.visit(PREDICATE_4, visitor); properties = visitor.getProperties(); Assert.assertEquals(2, properties.size()); Assert.assertEquals("Monkey", properties.get(PROPERTY_A)); Assert.assertEquals("Runner", properties.get(PROPERTY_B)); visitor = new PropertyPredicateVisitor(); PredicateHelper.visit(PREDICATE_5, visitor); properties = visitor.getProperties(); Assert.assertTrue(properties.isEmpty()); }