### Question:
MailServerImpl implements MailServer { @Override public void sendEmail(String to, String subject, String message, String mimeType) throws MessagingException { sendEmail(null, to, subject, message, mimeType, null); } MailServerImpl(String realm);  MailServerImpl(ServiceConfigManager mgr, ServiceConfig scm, Debug debug, AMSendMail sendMail,
                          Map<String, Set<String>> options); String getSubject(); String getMessage(); @Override void sendHtmlEmail(String to, String subject, String message); @Override void sendHtmlEmail(String from, String to, String subject, String message, Map<String, Set<String>> options); @Override void sendEmail(String to, String subject, String message, String mimeType); @Override void sendEmail(String to, String subject, String message); @Override void sendEmail(String from, String to, String subject, String message, Map<String, Set<String>> options); final static public String SERVICE_NAME; final static public String SERVICE_VERSION; }### Answer:
@Test public void testSendMailWithoutOptions(){ try { mailServerMock.sendEmail("to@gmail.com", "Subject", "Message"); verify(sendMailMock, times(1)).postMail(eq(recipients), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyBoolean()); } catch (MessagingException e){ assert(false); } }
@Test public void testSendMailWithOptions(){ try { mailServerMock.sendEmail("from@gmail.com", "to@gmail.com", "Subject", "Message", createOptionsMap()); verify(sendMailMock, times(1)).postMail(eq(recipients), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyBoolean()); } catch (MessagingException e){ assert(false); } }