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