NotificationEmailGenerator { public String generateEmail(Notification notification) { Assert.notNull(notification); return notification.getDetails(); }  String generateEmail(Notification notification);  }
@Test(expected = IllegalArgumentException.class) public void testGenerateEmail_Throws_Exception_Given_Null_Notification(){ NotificationEmailGenerator sut = new NotificationEmailGenerator(); sut.generateEmail(null); }
@Test public void testGenerateEmail_Returns_As_Expected(){ NotificationEmailGenerator sut = new NotificationEmailGenerator(); Notification notification = new Notification(); final String details = "details"; notification.setDetails(details); String result = sut.generateEmail(notification); assertEquals(details, result); }