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