### Question:
SplitRequest extends BaseModel { @NonNull public Amounts getProcessedAmounts() { Amounts processed = new Amounts(0, getRequestedAmounts().getCurrency()); if (transactions.isEmpty()) { return processed; } for (Transaction transaction : transactions) { processed = Amounts.addAmounts(processed, transaction.getProcessedAmounts()); } return processed; } SplitRequest();  SplitRequest(Payment sourcePayment, Amounts accumulatedRequestTotals, List<Transaction> transactions); @NonNull Payment getSourcePayment(); @NonNull List<Transaction> getTransactions(); boolean hasPreviousTransactions(); @Nullable Transaction getLastTransaction(); @NonNull Amounts getRequestedAmounts(); @NonNull Amounts getRemainingAmounts(); @NonNull Amounts getProcessedAmounts(); void setDeviceAudience(DeviceAudience deviceAudience); @NonNull DeviceAudience getDeviceAudience(); @Override String toJson(); static SplitRequest fromJson(String json);  }### Answer:
@Test public void shouldCalculateProcessedAmountsCorrectly() throws Exception { setupSplitRequestWith75PercentProcessed(); Amounts processedAmounts = splitRequest.getProcessedAmounts(); assertThat(processedAmounts).isEqualTo(new Amounts((TOTAL_AMOUNT / 4) * 3, CURRENCY)); }
@Test public void processedShouldReturnZeroIfNothingProcessed() throws Exception { setupWithNothingProcessed(); Amounts processedAmounts = splitRequest.getProcessedAmounts(); assertThat(processedAmounts).isEqualTo(new Amounts(0, CURRENCY)); }
@Test public void processedShouldReturnTotalIfAllProcessed() throws Exception { setupWithAllProcessed(); Amounts processedAmounts = splitRequest.getProcessedAmounts(); assertThat(processedAmounts).isEqualTo(new Amounts(TOTAL_AMOUNT, CURRENCY)); }