AbsoluteLength implements Length { @Override public boolean equals(final Object o) { if (!(o instanceof AbsoluteLength)) { return false; } final AbsoluteLength other = (AbsoluteLength) o; return this.mm - other.mm < MAX_DELTA && other.mm - this.mm < MAX_DELTA; } AbsoluteLength(final double mm); static AbsoluteLength mm(final double value); static AbsoluteLength cm(final double value); static AbsoluteLength in(final double value); static AbsoluteLength pt(final double value); static AbsoluteLength pc(final double value); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override boolean isNotNull(); @Override String getValue();  }
@Test public void testEquals() { Assert.assertEquals(AbsoluteLength.pt(VALUE), AbsoluteLength.pt(VALUE)); Assert.assertNotEquals(AbsoluteLength.pt(VALUE), AbsoluteLength.cm(VALUE)); Assert.assertNotEquals(AbsoluteLength.in(VALUE), AbsoluteLength.in(OTHER_VALUE)); Assert.assertNotEquals(AbsoluteLength.in(OTHER_VALUE), AbsoluteLength.in(VALUE)); Assert.assertNotEquals("10", AbsoluteLength.mm(VALUE)); Assert.assertNotEquals(AbsoluteLength.mm(VALUE), "10"); }