### Question:
CmsCorePaymentMapper { public BulkPaymentInitiationJson mapToBulkPaymentInitiationJson(List<PisPayment> payments) { if (CollectionUtils.isEmpty(payments)) { return null; } PisPayment pisPayment = payments.get(0); BulkPaymentInitiationJson payment = new BulkPaymentInitiationJson(); payment.setPayments(payments.stream().map(this::mapToPaymentInitiationBulkElementJson).collect(Collectors.toList())); payment.setBatchBookingPreferred(pisPayment.getBatchBookingPreferred()); payment.setDebtorAccount(mapToAccountReference(pisPayment.getDebtorAccount())); payment.setRequestedExecutionDate(pisPayment.getRequestedExecutionDate()); payment.setRequestedExecutionTime(pisPayment.getRequestedExecutionTime()); return payment; }  PaymentInitiationJson mapToPaymentInitiationJson(PisPayment pisPayment); PaymentInitiationJson mapToPaymentInitiationJson(List<PisPayment> payments); BulkPaymentInitiationJson mapToBulkPaymentInitiationJson(List<PisPayment> payments); PeriodicPaymentInitiationJson mapToPeriodicPaymentInitiationJson(List<PisPayment> payments);  }### Answer:
@Test void mapToBulkPaymentInitiationJson() { PisPayment pisPayment = jsonReader.getObjectFromFile("json/service/mapper/pis-payment.json", PisPayment.class); BulkPaymentInitiationJson actual = mapper.mapToBulkPaymentInitiationJson(Collections.singletonList(pisPayment)); BulkPaymentInitiationJson expected = jsonReader.getObjectFromFile("json/service/mapper/bulk-payment-initiation-resp.json", BulkPaymentInitiationJson.class); assertEquals(expected, actual); }
@Test void mapToBulkPaymentInitiationJson_nullValue() { assertNull(mapper.mapToBulkPaymentInitiationJson(null)); }