SelectItem[] selectItems = new SelectItem[] { s1, s2 };
CachingDataSetHeader header = new CachingDataSetHeader(selectItems);
FilterItem c = new FilterItem(s1, OperatorType.EQUALS_TO, null);
Row row = new DefaultRow(header, new Object[] { 1, 1 });
assertFalse(c.evaluate(row));
row = new DefaultRow(header, new Object[] { null, 1 });
assertTrue(c.evaluate(row));
c = new FilterItem(s1, OperatorType.EQUALS_TO, 1);
row = new DefaultRow(header, new Object[] { 1, 1 });
assertTrue(c.evaluate(row));
row = new DefaultRow(header, new Object[] { null, 1 });
assertFalse(c.evaluate(row));
c = new FilterItem(s1, OperatorType.DIFFERENT_FROM, 5);
row = new DefaultRow(header, new Object[] { 1, 1 });
assertTrue(c.evaluate(row));
row = new DefaultRow(header, new Object[] { null, 1 });
assertTrue(c.evaluate(row));
c = new FilterItem(s1, OperatorType.GREATER_THAN, s2);
row = new DefaultRow(header, new Object[] { 5, 1 });
assertTrue(c.evaluate(row));
row = new DefaultRow(header, new Object[] { null, 1 });
assertFalse(c.evaluate(row));
row = new DefaultRow(header, new Object[] { 1, null });
assertFalse(c.evaluate(row));
c = new FilterItem(s1, OperatorType.EQUALS_TO, s2);
row = new DefaultRow(header, new Object[] { 1, null });
assertFalse(c.evaluate(row));
row = new DefaultRow(header, new Object[] { null, null });
assertTrue(c.evaluate(row));
}