public void randomize(Random random){
  for (int j=numInstances() - 1; j > 0; j--) {
    swap(j,random.nextInt(j + 1));
  }
}

public void randomize ( Random random ) { for ( int j = numInstances ( ) - 1 ; j > 0 ; j -- ) { swap ( j , random . nextInt ( j + 1 ) ) ; } }
shuffles the instances in the set so that they are ordered randomly .
