### Question:
PisCommonPaymentServiceInternal implements PisCommonPaymentService { void transferCorePaymentToCommonPayment(PisCommonPaymentResponse pisCommonPaymentResponse, PisCommonPaymentData pisCommonPaymentData) { if (pisCommonPaymentData.getPayment() != null) { return; } List<PisPayment> pisPayments = pisCommonPaymentData.getPayments().stream() .map(pisCommonPaymentMapper::mapToPisPayment) .collect(Collectors.toList()); byte[] paymentData = corePaymentsConvertService.buildPaymentData(pisPayments, pisCommonPaymentData.getPaymentType()); if (paymentData != null) { pisCommonPaymentData.setPayment(paymentData); pisCommonPaymentResponse.setPaymentData(paymentData); } }  @Override @Transactional CmsResponse<CreatePisCommonPaymentResponse> createCommonPayment(PisPaymentInfo request); @Override @Transactional CmsResponse<TransactionStatus> getPisCommonPaymentStatusById(String paymentId); @Override @Transactional CmsResponse<PisCommonPaymentResponse> getCommonPaymentById(String paymentId); @Override @Transactional CmsResponse<Boolean> updateCommonPaymentStatusById(String paymentId, TransactionStatus status); @Override @Transactional CmsResponse<Boolean> updateMultilevelSca(String paymentId, boolean multilevelScaRequired); @Override CmsResponse<List<PsuIdData>> getPsuDataListByPaymentId(String paymentId);  }### Answer:
@Test void transferCorePaymentToCommonPayment_success() { PisCommonPaymentResponse pisCommonPaymentResponse = new PisCommonPaymentResponse(); PisPaymentData pisPaymentData = new PisPaymentData(); pisCommonPaymentData.setPayments(Collections.singletonList(pisPaymentData)); pisCommonPaymentData.setPayment(null); PisPayment pisPayment = new PisPayment(); when(pisCommonPaymentMapper.mapToPisPayment(pisPaymentData)).thenReturn(pisPayment); byte[] bytes = "content".getBytes(); when(corePaymentsConvertService.buildPaymentData(Collections.singletonList(pisPayment), pisCommonPaymentData.getPaymentType())) .thenReturn(bytes); pisCommonPaymentService.transferCorePaymentToCommonPayment(pisCommonPaymentResponse, pisCommonPaymentData); assertEquals(bytes, pisCommonPaymentResponse.getPaymentData()); verify(pisCommonPaymentMapper, times(1)).mapToPisPayment(pisPaymentData); verify(corePaymentsConvertService, times(1)).buildPaymentData(Collections.singletonList(pisPayment), pisCommonPaymentData.getPaymentType()); }