code: public void generateRandom(int n, Callback2d callback) {
          for (int y = 0; y < n; y++) {
              for (int x = 0; x < n; x++) {
                  float sampleX = (rnd.nextFloat() / n + (float) x / n) * 2.0f - 1.0f;
                  float sampleY = (rnd.nextFloat() / n + (float) y / n) * 2.0f - 1.0f;
                  callback.onNewSample(sampleX, sampleY);
              }
          }
      }
docs: Generate <code>n * n</code> random sample positions in the unit square of <code>x, y = [-1..+1]</code>.
  <p>
  Each sample within its stratum is distributed randomly.
  
  @param n
  the number of strata in each dimension
  @param callback
  will be called for each generated sample position