@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErroWhenIsNull() { operator.apply(null); fail(); }
@Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.multiply(percentValue); }
PercentOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.multiply(percentValue); } }
PercentOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.multiply(percentValue); } PercentOperator(final BigDecimal decimal); }
PercentOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.multiply(percentValue); } PercentOperator(final BigDecimal decimal); @Override MonetaryAmount apply(MonetaryAmount amount); @Override String toString(); }
PercentOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.multiply(percentValue); } PercentOperator(final BigDecimal decimal); @Override MonetaryAmount apply(MonetaryAmount amount); @Override String toString();  }