@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());
  }
Tests for the property predicate visitor.
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PropertyPredicateVisitorTest.java