@Test public void shouldCompare() { assertTrue(m2.isGreaterThanOrEqual(m2)); assertTrue(m2.isGreaterThanOrEqual(m1)); assertFalse(m1.isGreaterThanOrEqual(m2)); }
public boolean isGreaterThanOrEqual(Money other) { return amount.compareTo(other.amount) >= 0; }
Money { public boolean isGreaterThanOrEqual(Money other) { return amount.compareTo(other.amount) >= 0; } }
Money { public boolean isGreaterThanOrEqual(Money other) { return amount.compareTo(other.amount) >= 0; } private  Money();  Money(BigDecimal amount);  Money(String s);  Money(int i); }
Money { public boolean isGreaterThanOrEqual(Money other) { return amount.compareTo(other.amount) >= 0; } private  Money();  Money(BigDecimal amount);  Money(String s);  Money(int i); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Money add(Money delta); boolean isGreaterThanOrEqual(Money other); String asString(); Money multiply(int x); Long asLong(); }
Money { public boolean isGreaterThanOrEqual(Money other) { return amount.compareTo(other.amount) >= 0; } private  Money();  Money(BigDecimal amount);  Money(String s);  Money(int i); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Money add(Money delta); boolean isGreaterThanOrEqual(Money other); String asString(); Money multiply(int x); Long asLong(); static Money ZERO; }