CaseCommentMapper implements Function<CaseComment, CaseCommentSummary> { @Override public CaseCommentSummary apply(CaseComment c) { if (c == null) { return null; } return CaseCommentSummary.builder() .addedAt(c.getAddedAt()) .author(c.getAuthor()) .id(c.getId()) .text(c.getText()) .build(); }  @Override CaseCommentSummary apply(CaseComment c);  }
@Test public void testCaseCommentMapper_mapCaseComment() { final CaseComment cc = CaseComment.builder() .id("commentId") .author("admin") .text("commentText") .addedAt(new Date()) .build(); final CaseCommentSummary ccs = new CaseCommentMapper().apply(cc); assertCaseComment(cc, ccs); }
@Test public void testCaseCommentMapper_mapNull() { final CaseComment cc = null; final CaseCommentSummary ccs = new CaseCommentMapper().apply(cc); assertNull(ccs); }