Aer implements Comparable<Aer> { @Override public String toString() { if (null == this.value) { return EMPTY_STRING; } return toString(Unit.AER); } 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 testToString() { final Object[][] testParameters = new Object[][] { {"1", Unit.AER, Unit.AER.getName() + "(value=1)"}, {"1", Unit.GAER, Unit.GAER.getName() + "(value=0.000000001)"}, {"1", Unit.AERGO, Unit.AERGO.getName() + "(value=0.000000000000000001)"}, }; for (final Object[] parameters : testParameters) { final String value = (String) parameters[0]; final Unit unit = (Unit) parameters[1]; final String expected = (String) parameters[2]; final String actual = Aer.of(value).toString(unit); assertEquals(expected, actual); } }