### Question:
AccountSpiImpl implements AccountSpi { boolean isTransactionWithBookingStatus(Transaction transaction, BookingStatus bookingStatus) { if (bookingStatus.equals(BookingStatus.BOOKED)) { return transaction.getBookingDate() != null; } else if (bookingStatus.equals(BookingStatus.PENDING)) { return transaction.getBookingDate() == null; } return true; } AccountSpiImpl(TestDataService testDataService, TestDataMapper testDataMapper); @Override SpiResponse<List<SpiAccountDetails>> requestAccountList(
      @NotNull SpiContextData ctx,
      boolean withBalance,
      @NotNull SpiAccountConsent spiAccountConsent,
      @NotNull SpiAspspConsentDataProvider spiAspspConsentDataProvider); @Override SpiResponse<SpiAccountDetails> requestAccountDetailForAccount(
      @NotNull SpiContextData ctx,
      boolean withBalance,
      @NotNull SpiAccountReference spiAccountReference,
      @NotNull SpiAccountConsent spiAccountConsent,
      @NotNull SpiAspspConsentDataProvider spiAspspConsentDataProvider); @Override SpiResponse<SpiTransactionReport> requestTransactionsForAccount(
      @NotNull SpiContextData spiContextData,
      String acceptHeader,
      boolean withBalance,
      @NotNull LocalDate dateFrom,
      @NotNull LocalDate dateTo,
      @NotNull BookingStatus bookingStatus,
      @NotNull SpiAccountReference spiAccountReference,
      @NotNull SpiAccountConsent spiAccountConsent,
      @NotNull SpiAspspConsentDataProvider spiAspspConsentDataProvider); @Override SpiResponse<SpiTransaction> requestTransactionForAccountByTransactionId(
      @NotNull SpiContextData ctx,
      @NotNull String transactionId,
      @NotNull SpiAccountReference spiAccountReference,
      @NotNull SpiAccountConsent spiAccountConsent,
      @NotNull SpiAspspConsentDataProvider spiAspspConsentDataProvider); @Override SpiResponse<List<SpiAccountBalance>> requestBalancesForAccount(
      @NotNull SpiContextData ctx,
      @NotNull SpiAccountReference spiAccountReference,
      @NotNull SpiAccountConsent spiAccountConsent,
      @NotNull SpiAspspConsentDataProvider spiAspspConsentDataProvider);  }### Answer:
@Test public void transactionIsBooked() { Transaction transaction = mock(Transaction.class); when(transaction.getBookingDate()).thenReturn(LocalDate.now()); assertTrue(accountSpi.isTransactionWithBookingStatus(transaction, BookingStatus.BOOKED)); }
@Test public void transactionIsNotBooked() { Transaction transaction = mock(Transaction.class); assertFalse(accountSpi.isTransactionWithBookingStatus(transaction, BookingStatus.BOOKED)); }
@Test public void transactionIsPending() { Transaction transaction = mock(Transaction.class); assertTrue(accountSpi.isTransactionWithBookingStatus(transaction, BookingStatus.PENDING)); }