### Question:
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public String queryFrom(MonetaryAmount amount) { return Optional .ofNullable(amount) .map(m -> decimalFormat.format(amount.getNumber().numberValue( BigDecimal.class))).orElse("null"); } MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit); static MonetaryAmountFormat of(); String toLocalizedPattern(); String toPattern(); @Override AmountFormatContext getContext(); @Override void print(Appendable appendable, MonetaryAmount amount); @Override MonetaryAmount parse(CharSequence text); @Override String queryFrom(MonetaryAmount amount); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void shouldQueryFromNullWhenMonetaryAmountIsNull() throws IOException { assertEquals(format.queryFrom(null), "null"); }