### Question:
FastMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { @Override public <R> R query(MonetaryQuery<R> query) { Objects.requireNonNull(query); try { return query.queryFrom(this); } catch (MonetaryException | ArithmeticException e) { throw e; } catch (Exception e) { throw new MonetaryException("Query failed: " + query, e); } } private  FastMoney(Number number, CurrencyUnit currency); private  FastMoney(NumberValue numberValue, CurrencyUnit currency); private  FastMoney(long number, CurrencyUnit currency); @Override CurrencyUnit getCurrency(); @Override MonetaryContext getContext(); static FastMoney of(NumberValue numberBinding, CurrencyUnit currency); static FastMoney of(Number number, CurrencyUnit currency); static FastMoney of(Number number, String currencyCode); static FastMoney zero(CurrencyUnit currency); static FastMoney ofMinor(CurrencyUnit currency, long amountMinor); static FastMoney ofMinor(CurrencyUnit currency, long amountMinor, int factionDigits); @Override int compareTo(MonetaryAmount o); @Override int hashCode(); @Override boolean equals(Object obj); @Override FastMoney abs(); @Override FastMoney add(MonetaryAmount amount); @Override FastMoney divide(Number divisor); @Override FastMoney[] divideAndRemainder(Number divisor); @Override FastMoney divideToIntegralValue(Number divisor); @Override FastMoney multiply(Number multiplicand); @Override FastMoney negate(); @Override FastMoney plus(); @Override FastMoney subtract(MonetaryAmount subtrahend); @Override FastMoney remainder(Number divisor); @Override FastMoney scaleByPowerOfTen(int power); @Override boolean isZero(); @Override boolean isPositive(); @Override boolean isPositiveOrZero(); @Override boolean isNegative(); @Override boolean isNegativeOrZero(); int getScale(); int getPrecision(); @Override int signum(); @Override boolean isLessThan(MonetaryAmount amount); boolean isLessThan(Number number); @Override boolean isLessThanOrEqualTo(MonetaryAmount amount); boolean isLessThanOrEqualTo(Number number); @Override boolean isGreaterThan(MonetaryAmount amount); boolean isGreaterThan(Number number); @Override boolean isGreaterThanOrEqualTo(MonetaryAmount amount); boolean isGreaterThanOrEqualTo(Number number); @Override boolean isEqualTo(MonetaryAmount amount); boolean hasSameNumberAs(Number number); @Override NumberValue getNumber(); @Override String toString(); @Override FastMoney with(MonetaryOperator operator); @Override R query(MonetaryQuery<R> query); static FastMoney from(MonetaryAmount amount); static FastMoney parse(CharSequence text); static FastMoney parse(CharSequence text, MonetaryAmountFormat formatter); @Override FastMoney multiply(double multiplicand); @Override FastMoney divide(long divisor); @Override FastMoney divide(double divisor); @Override FastMoney remainder(long divisor); @Override FastMoney remainder(double divisor); @Override FastMoney[] divideAndRemainder(long divisor); @Override FastMoney[] divideAndRemainder(double divisor); @Override FastMoney stripTrailingZeros(); @Override FastMoney multiply(long multiplicand); @Override FastMoney divideToIntegralValue(long divisor); @Override FastMoney divideToIntegralValue(double divisor); @Override MonetaryAmountFactory<FastMoney> getFactory(); static final FastMoney MAX_VALUE; static final FastMoney MIN_VALUE; }### Answer:
@Test public void testQuery() { MonetaryQuery<Integer> q = amount -> FastMoney.from(amount).getPrecision(); FastMoney[] moneys = new FastMoney[]{FastMoney.of(100, "CHF"), FastMoney.of(34242344, "USD"), FastMoney.of(23123213.435, "EUR"), FastMoney.of(-23123213.435, "USS"), FastMoney.of(-23123213, "USN"), FastMoney.of(0, "GBP")}; for (FastMoney money : moneys) { assertEquals(money.query(q), (Integer) money.getPrecision()); } }