### Question:
Amounts implements Jsonable { @NonNull public static Amounts subtractAmounts(Amounts a1, Amounts a2, boolean keepZeroAmountAdditionals) { if (a1 == null || a2 == null || !a1.getCurrency().equals(a2.getCurrency())) { throw new IllegalArgumentException("Invalid amounts or trying to combine different currencies"); } long remainingBase = Math.max(a1.getBaseAmountValue() - a2.getBaseAmountValue(), 0); Map<String, Long> newAdditionals = new HashMap<>(a1.getAdditionalAmounts()); Map<String, Long> a2Additionals = a2.getAdditionalAmounts(); for (String a2Key : a2Additionals.keySet()) { if (newAdditionals.containsKey(a2Key)) { long additionalRemainder = Math.max(newAdditionals.get(a2Key) - a2Additionals.get(a2Key), 0); if (additionalRemainder > 0 || keepZeroAmountAdditionals) { newAdditionals.put(a2Key, additionalRemainder); } else { newAdditionals.remove(a2Key); } } } return new Amounts(remainingBase, a1.getCurrency(), newAdditionals); } Amounts();  Amounts(long baseAmount, String currency);  Amounts(Amounts from);  Amounts(long baseAmount, String currency, Map<String, Long> additionalAmounts); void addAdditionalAmount(String identifier, long amount); void addAdditionalAmountAsBaseFraction(String identifier, float fraction); @NonNull String getCurrency(); long getBaseAmountValue(); @NonNull Amount getBaseAmount(); boolean hasAdditionalAmount(String identifier); long getAdditionalAmountValue(String identifier); @NonNull Amount getAdditionalAmount(String identifier); @NonNull Map<String, Long> getAdditionalAmounts(); @JsonConverter.ExposeMethod(value = "totalAmount") long getTotalAmountValue(); long getTotalExcludingAmounts(String... amountIdentifiers); @NonNull Amount getTotalAmount(); double getCurrencyExchangeRate(); @NonNull String getOriginalCurrency(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @NonNull static Amounts addAmounts(Amounts a1, Amounts a2); @NonNull static Amounts subtractAmounts(Amounts a1, Amounts a2, boolean keepZeroAmountAdditionals); @Override String toJson();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void checkCantSubtractAmountsDifferentCurrency() throws Exception { Amounts.subtractAmounts(new Amounts(10L, "GBP"), new Amounts(10L, "USD"), false); }