@Test public void testVisit(){
  Set<String> supportedProperties=new HashSet<String>();
  supportedProperties.add(PROPERTY_A);
  supportedProperties.add(PROPERTY_B);
  supportedProperties.add(PROPERTY_C);
  SimplifyingPredicateVisitor visitor=new SimplifyingPredicateVisitor(supportedProperties);
  PREDICATE_1.accept(visitor);
  List<BasePredicate> simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(1,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_1,simplifiedPredicates.get(0));
  PREDICATE_3.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(1,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_3,simplifiedPredicates.get(0));
  PREDICATE_4.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(2,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_1,simplifiedPredicates.get(0));
  Assert.assertEquals(PREDICATE_2,simplifiedPredicates.get(1));
  PREDICATE_6.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(3,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_5,simplifiedPredicates.get(0));
  Assert.assertEquals(PREDICATE_1,simplifiedPredicates.get(1));
  Assert.assertEquals(PREDICATE_2,simplifiedPredicates.get(2));
  PREDICATE_8.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(4,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_5,simplifiedPredicates.get(0));
  Assert.assertEquals(PREDICATE_1,simplifiedPredicates.get(1));
  Assert.assertEquals(PREDICATE_2,simplifiedPredicates.get(2));
  Assert.assertEquals(PREDICATE_7,simplifiedPredicates.get(3));
  PREDICATE_9.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(4,simplifiedPredicates.size());
  PREDICATE_11.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(4,simplifiedPredicates.size());
  PREDICATE_13.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(1,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_1,simplifiedPredicates.get(0));
  PREDICATE_15.accept(visitor);
  simplifiedPredicates=visitor.getSimplifiedPredicates();
  Assert.assertEquals(1,simplifiedPredicates.size());
  Assert.assertEquals(PREDICATE_1,simplifiedPredicates.get(0));
}
