MailetPipelineLogging { @VisibleForTesting static String getMailetInfo(Mailet mailet) { return Optional.ofNullable(Strings.emptyToNull(mailet.getMailetInfo())) .orElse(mailet.getClass().getSimpleName()); }  static void logBeginOfMailetProcess(Mailet mailet, Mail mail); static void logEndOfMailetProcess(Mailet mailet, Mail mail);  }
@Test void getMailetInfoShouldReturnMailetInfoWhenGiven() { assertThat(MailetPipelineLogging.getMailetInfo(new MailetWithMailetInfo())) .isEqualTo("this is my info"); }
@Test void getMailetInfoShouldReturnSimpleClassNameWhenMailetInfoIsEmpty() { assertThat(MailetPipelineLogging.getMailetInfo(new MailetWithoutMailetInfo())) .isEqualTo("MailetWithoutMailetInfo"); }