### Question:
SpitterMailServiceImpl implements SpitterMailService { @Override public void sendSimpleSpittleEmail(String to, Spittle spittle) { SimpleMailMessage message = new SimpleMailMessage(); String spitterName = spittle.getSpitter().getFullName(); message.setFrom("noreply@spitter.com"); message.setTo(to); message.setSubject("New spittle from " + spitterName); message.setText(spitterName + " says: " + spittle.getText()); mailSender.send(message); } @Autowired  SpitterMailServiceImpl(JavaMailSender mailSender); @Override void sendSimpleSpittleEmail(String to, Spittle spittle); @Override void sendSpittleEmailWithAttachment(String to, Spittle spittle); void sendRichEmail(String to, Spittle spittle); void sendRichEmailWithVelocity(String to, Spittle spittle); void sendRichEmailWithThymeleaf(String to, Spittle spittle);  }### Answer:
@Test public void sendSimpleSpittleEmail() throws Exception { Spitter spitter = new Spitter(1L, "habuma", null, "Craig Walls", "c@habuma.com", true); Spittle spittle = new Spittle(1L, spitter, "Hiya!", new Date()); mailService.sendSimpleSpittleEmail("craig@habuma.com", spittle); MimeMessage[] receivedMessages = mailServer.getReceivedMessages(); assertEquals(1, receivedMessages.length); assertEquals("New spittle from Craig Walls", receivedMessages[0].getSubject()); assertEquals("Craig Walls says: Hiya!", ((String) receivedMessages[0].getContent()).trim()); Address[] from = receivedMessages[0].getFrom(); assertEquals(1, from.length); assertEquals("noreply@spitter.com", ((InternetAddress) from[0]).getAddress()); assertEquals("craig@habuma.com", ((InternetAddress) receivedMessages[0].getRecipients(RecipientType.TO)[0]).getAddress()); }