CommonsmailHelperImpl implements CommonsmailHelper { @Override public Tuple<String, String> createValidEmailFromString(String email) throws AddressException { InternetAddress internetAddress = new InternetAddress(email); Tuple<String, String> tuple = new Tuple<String, String>(internetAddress.getAddress(), internetAddress .getPersonal()); return tuple; }  @Override MultiPartEmail createMultiPartEmailWithContent(Mail mail); @Override void doPopulateMultipartMailWithContent(MultiPartEmail multiPartEmail, Mail mail); @Override void doSetServerParameter(MultiPartEmail multiPartEmail, String smtpHost,
            Integer smtpPort, Boolean smtpSsl, Boolean smtpStartTLS, Boolean smtpStartTLSRequired,
            String smtpUser, String smtpPassword,
            Boolean smtpDebug); @Override List<Tuple<String, String>> createListOfAddresses(Collection<String> emails); @Override Tuple<String, String> createValidEmailFromString(String email);  }
@Test public void testCreateValidEmailFromString() throws Exception { String user = "The user <the.user@me.com>"; Tuple<String, String> tuple = commonsmailHelper.createValidEmailFromString(user); assertEquals("the.user@me.com", tuple.x); assertEquals("The user", tuple.y); user = "email@me.com"; tuple = commonsmailHelper.createValidEmailFromString(user); assertEquals("email@me.com", tuple.x); assertEquals(null, tuple.y); }