Null extends GenericMailet { @Override public void service(Mail mail) { LOGGER.debug("Null mailet is destroying mail {} from {} for {}", mail.getName(), mail.getMaybeSender(), mail.getRecipients()); mail.setState(Mail.GHOST); }  @Override void service(Mail mail); @Override String getMailetInfo();  }
@Test public void shouldChangeStateToGhost() throws MessagingException { FakeMail mail = FakeMail.builder().name("mail").build(); mailet.service(mail); assertThat(mail.getState()).isEqualTo("ghost"); }