Percentage extends Magnitude<Percentage> { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null) { return false; } return other.getClass() == this.getClass() && equals((Percentage) other); } Percentage(final float value); Percentage add(final float value); Percentage add(final Percentage value); double doubleValue(); float floatValue(); int intValue(); @Override boolean isEqualTo(final Percentage magnitude); @Override boolean isLessThan(final Percentage magnitude); long longValue(); Percentage multiply(final float value); short shortValue(); Percentage subtract(final float value); Percentage subtract(final Percentage value); @Override boolean equals(final Object other); boolean equals(final Percentage other); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { assertEquals(p1, p2); assertNotSame(p1, p2); assertFalse(p1.equals(p3)); }