ArrayList 除重
看到一段简洁的 ArrayList 除重代码:
protected final <T> List<T> removeDuplicates(List<T> list) { return new ArrayList<T>(new LinkedHashSet<T>(list)); }
List 转 array:
String[] candidates = configurations.toArray(newString[configurations.size()]);