DeltaLong extends Delta { @Override public boolean equals(Object obj) { if (obj instanceof DeltaLong) { DeltaLong dl = (DeltaLong) obj; return base == dl.base && delta == dl.delta; } return false; } DeltaLong(long base, long delta); static Number deltaOrLong(Number base, long delta); @Override Delta add(Delta other); @Override Number add(Number other); long getBase(); long getDelta(); @Override Long getDeltaValue(); @Override Long getFullValue(); @Override long longValue(); @Override int intValue(); @Override float floatValue(); @Override double doubleValue(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEquals() { DeltaLong dl1 = new DeltaLong(100, 123); DeltaLong dl2 = new DeltaLong(0, 223); assertEquals(dl1, dl1); assertEquals(dl1.longValue(), dl2.longValue()); assertFalse(dl1.equals(dl2)); }