code: static public void sampleWithReplacement(int[] sampleCounts, int samples, Random rand)
      {
          Arrays.fill(sampleCounts, 0);
          for(int i = 0; i < samples; i++)
              sampleCounts[rand.nextInt(sampleCounts.length)]++;
      }
docs: Performs the sampling based on the number of data points, storing the
  counts in an array to be constructed from XXXX
  @param sampleCounts an array to keep count of how many times each data
  point was sampled. The array will be filled with zeros before sampling
  starts
  @param samples the number of samples to take from the data set
  @param rand the source of randomness