Aer implements Comparable<Aer> { @Override public int compareTo(final Aer other) { assertNotNull(other, "Other is null"); return this.value.compareTo(other.value); } Aer(final String amount);  Aer(final String amount, final Unit unit);  Aer(final BigInteger amount); protected  Aer(); static Aer of(final String amount); static Aer of(final String amount, final Unit unit); static Aer of(final BigInteger amount); Aer add(final Aer other); Aer subtract(final Aer other); @Override int compareTo(final Aer other); @Override String toString(); String toString(final Unit unit); static final String EMPTY_STRING; static final Aer EMPTY; static final Aer ZERO; static final Aer ONE; static final Aer GIGA_ONE; static final Aer AERGO_ONE; }
@Test public void testCompareTo() { final Aer bottom = Aer.of("1", Unit.AER); final Aer middle = Aer.of("2", Unit.AER); final Aer top = Aer.of("3", Unit.AER); assertEquals(1, middle.compareTo(bottom)); assertEquals(0, middle.compareTo(middle)); assertEquals(-1, middle.compareTo(top)); }
@Test public void testCompareToOnNull() { try { final Aer aer = Aer.ZERO; aer.compareTo(null); } catch (AssertionError e) { } }