@Test public void send_anyEmailSender_willcallSendOnEmailSender() { Email email = mock(Email.class); EmailSender emailSender = mock(EmailSender.class); EmailService.emailSender = emailSender; EmailService.send(email); verify(emailSender).send(email); }
public static void send(Email email) { if (emailSender == null) { emailSender = EmailSenderImpl.buildDefault(); } emailSender.send(email); }
EmailService { public static void send(Email email) { if (emailSender == null) { emailSender = EmailSenderImpl.buildDefault(); } emailSender.send(email); } }
EmailService { public static void send(Email email) { if (emailSender == null) { emailSender = EmailSenderImpl.buildDefault(); } emailSender.send(email); }  }
EmailService { public static void send(Email email) { if (emailSender == null) { emailSender = EmailSenderImpl.buildDefault(); } emailSender.send(email); }  static void send(Email email); }
EmailService { public static void send(Email email) { if (emailSender == null) { emailSender = EmailSenderImpl.buildDefault(); } emailSender.send(email); }  static void send(Email email);  }