### Question:
SplitModel extends BaseStageModel { public boolean lastTransactionFailed() { return splitRequest.hasPreviousTransactions() && !splitRequest.getLastTransaction().hasProcessedRequestedAmounts() && splitRequest.getLastTransaction().hasDeclinedResponses(); } private  SplitModel(Activity activity, SplitRequest splitRequest); private  SplitModel(ClientCommunicator clientCommunicator, SplitRequest splitRequest, InternalData senderInternalData); @NonNull static SplitModel fromActivity(Activity activity); @NonNull static SplitModel fromService(ClientCommunicator clientCommunicator, SplitRequest request, InternalData senderInternalData); @NonNull SplitRequest getSplitRequest(); boolean lastTransactionFailed(); void setBaseAmountForNextTransaction(long baseAmount); void setBasketForNextTransaction(Basket basket); @SafeVarargs final void addRequestData(String key, T... values); void setAmountsPaid(Amounts amountsPaid, String paymentMethod); void setAmountsPaid(Amounts amountsPaid, String paymentMethod, AdditionalData paymentReferences); void cancelFlow(); void sendResponse(); void skip(); @Override @NonNull String getRequestJson();  }### Answer:
@Test public void shouldReportLastTransactionFailedAsFalseIfNoTransactions() throws Exception { assertThat(splitModel.lastTransactionFailed()).isFalse(); }
@Test public void shouldReportLastTransactionFailedAsTrueIfPrevTxnFailed() throws Exception { Basket prevTxnBasket = new Basket("txnOneBasket", new BasketItemBuilder().withLabel("item") .withAmount(totalRequestValue / 2).withQuantity(1).build()); Transaction prevTxn = new Transaction(new Amounts(totalRequestValue / 2, "GBP"), Arrays.asList(prevTxnBasket), null, null); prevTxn.addTransactionResponse(new TransactionResponseBuilder(prevTxn.getId()).decline("failed").build()); prevTransactions.add(prevTxn); assertThat(splitModel.lastTransactionFailed()).isTrue(); }