public void testSort2(){
List<String> stringlist = new ArrayList<String>();
Random random = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i <10 ; i++) {
for (int j = 1; j <i ; j++) {
if (stringlist.get(j).equals(stringlist.get(j-1))){
i--;
break;
}
}
System.out.println("将要添加第"+ (i+1) +"个字符串");
for (int j = 0; j <random.nextInt(10)+1 ; j++) {
char a = (char) (random.nextInt(26)+65);
char b = (char) (random.nextInt(26)+ 97);
if (random.nextBoolean()){
sb.append(a);
}else {
sb.append(b);
}
}
stringlist.add(sb.toString());
sb.delete(0,sb.length());
}