Money extends Magnitude<Money> { @Override public boolean isLessThan(final Money magnitude) { if (!hasSameCurrency(magnitude)) { throw new IllegalArgumentException("Parameter must be of type Money and have the same currency"); } return amount < (magnitude).amount; } Money(final double amount, final String currency);  Money(final long amount, final String currency); Money add(final Money money); double doubleValue(); float floatValue(); BigDecimal getAmount(); String getCurrency(); boolean hasSameCurrency(final Money money); int intValue(); @Override boolean isEqualTo(final Money magnitude); boolean isGreaterThanZero(); @Override boolean isLessThan(final Money magnitude); boolean isLessThanZero(); boolean isZero(); long longValue(); Money subtract(final Money money); @Override boolean equals(final Object other); boolean equals(final Money other); @Override int hashCode(); @Override String toString();  }
@Test public void testIsLessThan() { final Money m1 = new Money(98, "pds"); final Money m2 = new Money(100, "pds"); assertTrue(m1.isLessThan(m2)); }
@Test public void testIsLessThanFails() { final Money m1 = new Money(98, "pds"); final Money m2 = new Money(100, "pds"); assertFalse(m2.isLessThan(m1)); }