SimpleMailService extends AbstractMailService<T> { @Override public void send(final T content) { Email email = new Email(getMail()); getMailSenderAdapter().send(email); }  @Override void send(final T content);  }
@Test public void testSend() throws Exception { String content = "simple email"; Email email = new Email(mail); unit.send(content); verify(mailSenderAdapter).send(email); }
@Test(expected = MailException.class) public void testSendWithException() throws Exception { String content = "simple email"; Email email = new Email(mail); doThrow(MailException.class).when(mailSenderAdapter).send(any(Email.class)); unit.send(content); verify(mailSenderAdapter).send(email); }