code: public int[] getSample(int sampleSize)
    {
      int[] sample = new int[sampleSize];
      for(int i = 0; i< sampleSize;i++){
        sample[i] = randGenerator.nextInt(this.dataDimension()); //Just generate a random index
      }
      return sample;
    }
docs: Gets a random sample (this is sampling with replacement)
  @param sampleSize number of samples to generate
  @return array of indices for random sample of sampleSize