public void getRandomString(){
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
Random random = new Random();
List<String> list = new ArrayList<String>();
for(int j=0;j<10;j++){
int length = random.nextInt(10);
StringBuffer sf=new StringBuffer();
do{
for(int i=0;i<length;i++){
int sb = random.nextInt(length);
sf.append(base.charAt(sb));
System.out.println("str:"+sf);
}
}while(list.contains(sf.toString()));
list.add(sf.toString());
}
System.out.println("sort before:");
for(String in:list){
System.out.println("element:"+in);
}
System.out.println("sort after:");
Collections.sort(list);
for(String in:list){
System.out.println("element:"+in);
}
}