ReportAppender { public static StringBuilder appendInfoMessage(String message, StringBuilder report) { if (!message.isEmpty()){ String formattedMessage = String.format("%s %s", getTimeStamp(), message); System.out.println(StringEscapeUtils.unescapeJava(formattedMessage)); report.append(formattedMessage).append(System.lineSeparator()); }else { report.append(message).append(System.lineSeparator()); } return report; }  static StringBuilder appendStartedMessage(String message, StringBuilder report, Class classType); static StringBuilder appendCompletedMessage(String message, StringBuilder report, JobStatus status); static StringBuilder appendCompletedMessage(String message, StringBuilder report, TaskStatus status); static StringBuilder appendInfoMessage(String message, StringBuilder report);  }
@Test public void appendInfoMessage() { String message = "Test message"; StringBuilder report = new StringBuilder(); String actualResult = ReportAppender.appendInfoMessage(message, report).toString(); Assert.assertTrue(actualResult.contains(message)); }