protected static String[] copyAndSort(String[] input){
  String[] result=new String[input.length];
  System.arraycopy(input,0,result,0,input.length);
  Arrays.sort(result);
  return result;
}

protected static String [ ] copyAndSort ( String [ ] input ) { String [ ] result = new String [ input . length ] ; System . arraycopy ( input , 0 , result , 0 , input . length ) ; Arrays . sort ( result ) ; return result ; }
copy an sort the input array .
