VisibilityBindingSet extends BindingSetDecorator { @Override public int hashCode() { return Objects.hash(visibility, super.getBindingSet()); } VisibilityBindingSet(final BindingSet set);  VisibilityBindingSet(final BindingSet set, final String visibility); void setVisibility(final String visibility); String getVisibility(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void hashcode() { final ValueFactory vf = SimpleValueFactory.getInstance(); final MapBindingSet bSet = new MapBindingSet(); bSet.addBinding("name", vf.createLiteral("alice")); final VisibilityBindingSet visSet = new VisibilityBindingSet(bSet); final int origHash = visSet.hashCode(); bSet.addBinding("age", vf.createLiteral(37)); final int updatedHash = visSet.hashCode(); assertNotEquals(origHash, updatedHash); }