Here you can find the source of concatName(String name, List
public static String concatName(String name, List<String> names)
//package com.java2s; //License from project: Open Source License import java.util.Collections; import java.util.List; public class Main { public static String concatName(String name, List<String> names) { names.add(name);/* ww w .j a v a 2 s . c om*/ Collections.sort(names); StringBuilder sb = new StringBuilder(); for (String id : names) { sb.append(id); } return sb.toString(); } }