合并邮件地址
//package com.nowjava; /** 来 自 N o w J a v a . c o m - 时代Java **/ import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; public class Main { public static void main(String[] argv) throws Exception { List in = java.util.Arrays.asList("asdf", "nowjava.com"); System.out.println(mergeAddresses(in)); /* 时 代 J a v a 公 众 号 - nowjava.com 提 供 */ } public static List<InternetAddress> mergeAddresses( List<InternetAddress>... in) throws AddressException { Set<String> emails = new HashSet<>(); List<InternetAddress> ret = new ArrayList<InternetAddress>(); for (List<InternetAddress> la : in) {