### Question:
Coin implements Monetary, Comparable<Coin>, Serializable { public static Coin valueOf(final long satoshis) { return new Coin(satoshis); } private  Coin(final long satoshis); static Coin valueOf(final long satoshis); @Override int smallestUnitExponent(); @Override long getValue(); static Coin valueOf(final int coins, final int cents); static Coin parseCoin(final String str); static Coin parseCoinInexact(final String str); Coin add(final Coin value); Coin plus(final Coin value); Coin subtract(final Coin value); Coin minus(final Coin value); Coin multiply(final long factor); Coin times(final long factor); Coin times(final int factor); Coin divide(final long divisor); Coin div(final long divisor); Coin div(final int divisor); Coin[] divideAndRemainder(final long divisor); long divide(final Coin divisor); boolean isPositive(); boolean isNegative(); boolean isZero(); boolean isGreaterThan(Coin other); boolean isLessThan(Coin other); Coin shiftLeft(final int n); Coin shiftRight(final int n); @Override int signum(); Coin negate(); long longValue(); String toFriendlyString(); String toPlainString(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final Coin other); static final int SMALLEST_UNIT_EXPONENT; static final Coin ZERO; static final Coin COIN; static final Coin CENT; static final Coin MILLICOIN; static final Coin MICROCOIN; static final Coin SATOSHI; static final Coin FIFTY_COINS; static final Coin NEGATIVE_SATOSHI; final long value; }### Answer:
@Test public void testValueOf() { assertEquals(CENT, valueOf(0, 1)); assertEquals(SATOSHI, valueOf(1)); assertEquals(NEGATIVE_SATOSHI, valueOf(-1)); assertEquals(MAX_MONEY, valueOf(MAX_MONEY.value)); assertEquals(MAX_MONEY.negate(), valueOf(MAX_MONEY.value * -1)); valueOf(MAX_MONEY.value + 1); valueOf((MAX_MONEY.value * -1) - 1); valueOf(Long.MAX_VALUE); valueOf(Long.MIN_VALUE); try { valueOf(1, -1); fail(); } catch (IllegalArgumentException e) {} try { valueOf(-1, 0); fail(); } catch (IllegalArgumentException e) {} }
@Test public void testValueOf() { assertEquals(CENT, valueOf(0, 1)); assertEquals(SATOSHI, valueOf(1)); assertEquals(NEGATIVE_SATOSHI, valueOf(-1)); assertEquals(MAX_MONEY, valueOf(MAX_MONEY.value)); assertEquals(MAX_MONEY.negate(), valueOf(MAX_MONEY.value * -1)); valueOf(MAX_MONEY.value + 1); valueOf((MAX_MONEY.value * -1) - 1); valueOf(Long.MAX_VALUE); valueOf(Long.MIN_VALUE); try { valueOf(1, -1); fail(); } catch (IllegalArgumentException e) { } try { valueOf(-1, 0); fail(); } catch (IllegalArgumentException e) { } }