assertEquals(like, result);
}
@Test
public void testBinaryComparison() {
PropertyIsEqualTo equal = ff.equal(ff.property("a"), ff.property("b"), false);
NullHandlingVisitor visitor = new NullHandlingVisitor();
Filter result = (Filter) equal.accept(visitor, null);
assertTrue(result instanceof And);
Filter expected = ff.and(Arrays.asList(equal, propertyNotNull("a"), propertyNotNull("b")));
assertEquals(expected, result);
equal = ff.equal(ff.property("a"), ff.literal(10), false);
result = (Filter) equal.accept(visitor, null);
assertTrue(result instanceof And);
expected = ff.and(Arrays.asList(equal, propertyNotNull("a")));
assertEquals(expected, result);
equal = ff.equal(ff.literal(10), ff.property("b"), false);
result = (Filter) equal.accept(visitor, null);
assertTrue(result instanceof And);
expected = ff.and(Arrays.asList(equal, propertyNotNull("b")));
assertEquals(expected, result);
equal = ff.equal(ff.literal(10), ff.literal(20), false);
result = (Filter) equal.accept(visitor, null);
assertEquals(equal, result);
}