### Question:
LedgersSpiPaymentToMapper { public PaymentTO toPaymentTO_Single(SpiPaymentInfo spiPaymentInfo) { return Optional.ofNullable(spiPaymentInfo.getPaymentData()) .filter(ArrayUtils::isNotEmpty) .map(paymentData -> convert(paymentData, PaymentInitiationJson.class)) .map(payment -> { PaymentTO paymentTO = new PaymentTO(); paymentTO.setPaymentId(spiPaymentInfo.getPaymentId()); paymentTO.setPaymentType(PaymentTypeTO.valueOf(spiPaymentInfo.getPaymentType().name())); paymentTO.setPaymentProduct(spiPaymentInfo.getPaymentProduct()); paymentTO.setDebtorAccount(mapToAccountReferenceTO(payment.getDebtorAccount())); paymentTO.setDebtorName(payment.getUltimateDebtor()); paymentTO.setTargets(Collections.singletonList(mapToPaymentTargetTO(payment, spiPaymentInfo))); return paymentTO; }) .orElse(null); }  PaymentTO toPaymentTO_Single(SpiPaymentInfo spiPaymentInfo); PaymentTO toPaymentTO_Bulk(SpiPaymentInfo spiPaymentInfo); PaymentTO toPaymentTO_Periodic(SpiPaymentInfo spiPaymentInfo);  }### Answer:
@Test void toPaymentTO_Single() { PaymentTO expectedResult = jsonReader.getObjectFromFile("json/mappers/payment-to-from-single-payment-Initiation.json", PaymentTO.class); SpiPaymentInfo spiPaymentInfo = jsonReader.getObjectFromFile("json/mappers/payment-initiation.json", SpiPaymentInfo.class); PaymentTO actualResult = ledgersSpiPaymentToMapper.toPaymentTO_Single(spiPaymentInfo); assertEquals(expectedResult, actualResult); }