### Question:
AmountsModifier { @NonNull public AmountsModifier setAdditionalAmount(String identifier, long amount, boolean allowReduction) { if (amount >= 0) { Long existingValue = additionalAmounts.get(identifier); if (existingValue != null && amount < existingValue && !allowReduction) { throw new IllegalArgumentException("Reducing an existing amount is not allowed"); } additionalAmounts.put(identifier, amount); hasModifications = true; } return this; } AmountsModifier(Amounts originalAmounts); @NonNull AmountsModifier changeCurrency(String currency, double exchangeRate); @NonNull AmountsModifier updateBaseAmount(long baseAmountValue); @NonNull AmountsModifier offsetBaseAmount(long baseAmountOffset); @NonNull AmountsModifier setAdditionalAmount(String identifier, long amount, boolean allowReduction); @NonNull AmountsModifier setAdditionalAmountAsBaseFraction(String identifier, float fraction); boolean hasModifications(); @NonNull Amounts build(); static float percentageToFraction(int percentage);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowReducingAdditional() throws Exception { Amounts original = new Amounts(100, "GBP"); original.addAdditionalAmount("cashback", 100); new AmountsModifier(original).setAdditionalAmount("cashback", 50, false); }