private static Vector permuteList(Vector arr,SecureRandom rand){
  Vector retval=new Vector();
  Vector tmp=new Vector();
  for (int i=0; i < arr.size(); i++) {
    tmp.addElement(arr.elementAt(i));
  }
  retval.addElement(tmp.elementAt(0));
  tmp.removeElementAt(0);
  while (tmp.size() != 0) {
    retval.insertElementAt(tmp.elementAt(0),getInt(rand,retval.size() + 1));
    tmp.removeElementAt(0);
  }
  return retval;
}

private static Vector permuteList ( Vector arr , SecureRandom rand ) { Vector retval = new Vector ( ) ; Vector tmp = new Vector ( ) ; for ( int i = 0 ; i < arr . size ( ) ; i ++ ) { tmp . addElement ( arr . elementAt ( i ) ) ; } retval . addElement ( tmp . elementAt ( 0 ) ) ; tmp . removeElementAt ( 0 ) ; while ( tmp . size ( ) != 0 ) { retval . insertElementAt ( tmp . elementAt ( 0 ) , getInt ( rand , retval . size ( ) + 1 ) ) ; tmp . removeElementAt ( 0 ) ; } return retval ; }
generates a permuted arraylist from the original one . the original list is not modified
