public void test2(){
List<String> StringList=new ArrayList<String>();
Random random=new Random();
char [] charArray=("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray();
for(int j=0;j<10;j++){
StringBuilder sb=new StringBuilder();
do{
for(int i=0;i<random.nextInt(10)+1;i++){
sb.append(charArray[random.nextInt(62)]);
}
StringList.add(sb.toString());
}
while(StringList.contains(sb.toString()));
}
System.out.println("*********排序前*********");
for (String string : StringList) {
System.out.println(string);
}
System.out.println("********排序后***********");
Collections.sort(StringList);
for (String string : StringList) {
System.out.println(string);
}
}