CtripPlatformEmailService implements EmailService { @VisibleForTesting protected static String encodeListString(List<String> strs) { StringBuffer sb = new StringBuffer(); for(String str : strs) { sb.append(str).append(","); } sb.deleteCharAt(sb.length() - 1); return sb.toString(); }  @Override void sendEmail(Email email); @Override CheckEmailResponse checkEmailAddress(String address); @Override CommandFuture<EmailResponse> sendEmailAsync(Email email); @Override CommandFuture<EmailResponse> sendEmailAsync(Email email, Executor executor); @Override @SuppressWarnings("unchecked") boolean checkAsyncEmailResult(EmailResponse response); @Override int getOrder();  }
@Test public void testEncodeListString() { String expected = "123,456,789"; String result = CtripPlatformEmailService.encodeListString(Lists.newArrayList("123", "456", "789")); Assert.assertEquals(expected, result); }