### Question:
LedgersSpiAccountMapper { public SpiAccountReference toSpiAccountReference(AccountReferenceTO reference) { return Optional.ofNullable(reference) .map(r -> new SpiAccountReference( r.getIban(), r.getIban(), r.getIban(), r.getBban(), r.getPan(), r.getMaskedPan(), r.getMsisdn(), r.getCurrency())) .orElse(null); }  SpiAccountDetails toSpiAccountDetails(AccountDetailsTO accountDetails); SpiCardAccountDetails toSpiCardAccountDetails(AccountDetailsTO accountDetails); abstract List<SpiTransaction> toSpiTransactions(List<TransactionTO> transactions); abstract List<SpiCardTransaction> toSpiCardTransactions(List<TransactionTO> transactions); SpiTransaction toSpiTransaction(TransactionTO transaction); SpiCardTransaction toSpiCardTransaction(TransactionTO transaction); SpiAccountReference toSpiAccountReference(AccountReferenceTO reference); abstract List<SpiAccountBalance> toSpiAccountBalancesList(List<AccountBalanceTO> accountBalanceTOS); @Mapping(target = "spiBalanceType", expression = "java(mapToSpiBalanceType(accountBalanceTO.getBalanceType()))") @Mapping(source = "amount", target = "spiBalanceAmount") abstract SpiAccountBalance accountBalanceTOToSpiAccountBalance(AccountBalanceTO accountBalanceTO); abstract List<SpiExchangeRate> toSpiExchangeRateList(List<ExchangeRateTO> exchangeRates); SpiExchangeRate toSpiExchangeRate(ExchangeRateTO exchangeRate); SpiAmount toSpiAmount(AmountTO amount); abstract FundsConfirmationRequestTO toFundsConfirmationTO(SpiPsuData psuData, SpiFundsConfirmationRequest spiFundsConfirmationRequest); abstract AccountReferenceTO mapToAccountReferenceTO(SpiAccountReference spiAccountReference); String mapToRemittanceString(RemittanceInformationStructuredTO remittanceInformationStructuredTO);  }### Answer:
@Test void toSpiAccountReferenceWithRealData() { AccountReferenceTO inputData = jsonReader.getObjectFromFile("json/mappers/account-reference-to.json", AccountReferenceTO.class); SpiAccountReference actualResult = ledgersSpiAccountMapper.toSpiAccountReference(inputData); SpiAccountReference expectedResult = jsonReader.getObjectFromFile("json/mappers/spi-account-reference.json", SpiAccountReference.class); assertEquals(expectedResult, actualResult); }
@Test void toSpiAccountReferenceWithNull() { SpiAccountReference actualResult = ledgersSpiAccountMapper.toSpiAccountReference(null); assertNull(actualResult); }