SimpleBindings bindings = new SimpleBindings();
bindings.add(new SortField("a", SortField.Type.INT));
bindings.add(new SortField("b", SortField.Type.INT));
ValueSource vs1 = expr.getValueSource(bindings);
// same instance
assertEquals(vs1, vs1);
// null
assertFalse(vs1.equals(null));
// other object
assertFalse(vs1.equals("foobar"));
// same bindings and expression instances
ValueSource vs2 = expr.getValueSource(bindings);
assertEquals(vs1.hashCode(), vs2.hashCode());
assertEquals(vs1, vs2);
// equiv bindings (different instance)
SimpleBindings bindings2 = new SimpleBindings();
bindings2.add(new SortField("a", SortField.Type.INT));
bindings2.add(new SortField("b", SortField.Type.INT));
ValueSource vs3 = expr.getValueSource(bindings2);
assertEquals(vs1, vs3);
// different bindings (same names, different types)
SimpleBindings bindings3 = new SimpleBindings();
bindings3.add(new SortField("a", SortField.Type.LONG));
bindings3.add(new SortField("b", SortField.Type.INT));
ValueSource vs4 = expr.getValueSource(bindings3);
assertFalse(vs1.equals(vs4));
}