### Question:
Utils { public static Credit creditFromCreditBPM(CreditBPM creditBPM, String threadId) { Credit credit = new Credit(); credit.setAdditionalNotes(creditBPM.getAdditionalNotes()); credit.setPayerName(creditBPM.getPayerName()); credit.setRecipientName(creditBPM.getRecipientName()); credit.setReference(creditBPM.getServiceRef()); credit.setApplicationMessageId(creditBPM.getApplicationMessageID()); credit.setCreatedDate(creditBPM.getCreatedDate()); credit.setCreatedTime(creditBPM.getCreatedTime()); credit.setAmount(creditBPM.getValue().getUnits()); credit.setCurrency(creditBPM.getValue().getCurrencyCode()); credit.setThreadId(threadId); return credit; }  static String timestampToDate(long seconds, int nanos); static String timestampToTime(long seconds, int nanos); static String applicationMessageIdToString(ApplicationMessageID transactionId); static String transactionIdToString(TransactionId transactionId); static Credit creditFromCreditBPM(CreditBPM creditBPM, String threadId); static CreditBPM creditBPMFromCredit(Credit credit); static Settlement settlementFromSettleProposeBPM(SettleProposeBPM settleProposeBPM, String threadId); static ApplicationMessageID applicationMessageIdFromString(String appMessageId); static String getThreadId(); static Money moneyFromSettlement(Settlement settlement); static ResponseEntity<SettlementRest> serverError();  }### Answer:
@Test public void testCreditFromCreditBPM() { CreditBPM.Builder creditBPM = CreditBPM.newBuilder(); creditBPM.setAdditionalNotes("additional notes"); creditBPM.setApplicationMessageID("application message id"); creditBPM.setCreatedDate("created date"); creditBPM.setCreatedTime("created time"); creditBPM.setPayerName("Payer name"); creditBPM.setRecipientName("Recipient name"); creditBPM.setServiceRef("Service ref"); creditBPM.setValue(Money.newBuilder().setCurrencyCode("currency").setUnits(10).setNanos(20).build()); Credit credit = Utils.creditFromCreditBPM(creditBPM.build(), "threadId"); assertEquals(creditBPM.getAdditionalNotes(), credit.getAdditionalNotes()); assertEquals(creditBPM.getApplicationMessageID(), credit.getApplicationMessageId()); assertEquals(creditBPM.getCreatedDate(), credit.getCreatedDate()); assertEquals(creditBPM.getCreatedTime(), credit.getCreatedTime()); assertEquals(creditBPM.getPayerName(), credit.getPayerName()); assertEquals(creditBPM.getRecipientName(), credit.getRecipientName()); assertEquals(creditBPM.getServiceRef(), credit.getReference()); assertEquals(creditBPM.getValue().getUnits(), credit.getAmount()); assertEquals(creditBPM.getValue().getCurrencyCode(), credit.getCurrency()); assertEquals("threadId", credit.getThreadId()); assertNull(credit.getStatus()); }