IntegerValue implements Value<Integer> { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } IntegerValue(Integer value); @Override Double getDouble(); @Override Integer getValue(); @Override void setValue(Integer value); @Override int compareTo(Value<Integer> arg); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void hashCodeTest() { IntegerValue dnull = new IntegerValue(null); Integer d = 1; IntegerValue d1 = new IntegerValue(d); Assert.assertEquals(31, dnull.hashCode()); Assert.assertEquals(31 + d.hashCode(), d1.hashCode()); }