DummyBooleanSBool implements SBool { @Override public int hashCode() { return (value ? 1 : 0); } DummyBooleanSBool(boolean value); Boolean getValue(); @Override String toString(); @Override SBool out(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testHashCode() throws Exception { DummyBooleanSBool value1 = new DummyBooleanSBool(true); DummyBooleanSBool value2 = new DummyBooleanSBool(true); DummyBooleanSBool value3 = new DummyBooleanSBool(false); Assert.assertThat(value1.hashCode(), Is.is(value2.hashCode())); Assert.assertThat(value1.hashCode(), IsNot.not(value3.hashCode())); Assert.assertThat(value1.hashCode(), Is.is(value1.hashCode())); }