Program: 57162
Project: 57162
Buggy source:
/** 
 * Timing.
 * @param repeatChunk Each timing measurement will done done for thatnumber of repeats of the code.
 * @param repeatStat Timing will be averaged over that number of runs.
 * @param runGC Call {@code System.gc()} between each timed block. Whenset to  {@code true}, the test will run much slower.
 * @param methods Codes being timed.
 * @return for each of the given {@code methods} (first dimension), andeach of the  {@code repeatStat} runs (second dimension):<ul> <li> the average time (in milliseconds) taken by a single call to the {@code call} method (i.e. the time taken by each timed block dividedby  {@code repeatChunk}) </li> <li> the result returned by the   {@code call} method.</li> </ul>
 */
public static double[][][] timesAndResults(int repeatChunk,int repeatStat,boolean runGC,Callable<Double>... methods){
  final int numMethods=methods.length;
  final double[][][] timesAndResults=new double[numMethods][repeatStat][2];
  try {
    for (int k=0; k < repeatStat; k++) {
      for (int j=0; j < numMethods; j++) {
        if (runGC) {
          System.gc();
        }
        final Callable<Double> r=methods[j];
        final double[] result=new double[repeatChunk];
        final long start=System.nanoTime();
        for (int i=0; i < repeatChunk; i++) {
          result[i]=r.call().doubleValue();
        }
        final long stop=System.nanoTime();
        timesAndResults[j][k][0]=(stop - start) * NANO_TO_MILLI;
        timesAndResults[j][k][1]=result[rng.nextInt(repeatChunk)];
      }
    }
  }
 catch (  Exception e) {
    throw new MathIllegalStateException(LocalizedFormats.SIMPLE_MESSAGE,e.getMessage());
  }
  final double normFactor=1d / repeatChunk;
  for (int j=0; j < numMethods; j++) {
    for (int k=0; k < repeatStat; k++) {
      timesAndResults[j][k][0]*=normFactor;
    }
  }
  return timesAndResults;
}

Fixed version (ground truth):
/** 
 * Timing.
 * @param repeatChunk Each timing measurement will done done for thatnumber of repeats of the code.
 * @param repeatStat Timing will be averaged over that number of runs.
 * @param runGC Call {@code System.gc()} between each timed block. Whenset to  {@code true}, the test will run much slower.
 * @param methods Codes being timed.
 * @return for each of the given {@code methods} (first dimension), andeach of the  {@code repeatStat} runs (second dimension):<ul> <li> the average time (in milliseconds) taken by a single call to the {@code call} method (i.e. the time taken by each timed block dividedby  {@code repeatChunk}) </li> <li> the result returned by the   {@code call} method.</li> </ul>
 */
@SafeVarargs public static double[][][] timesAndResults(int repeatChunk,int repeatStat,boolean runGC,Callable<Double>... methods){
  final int numMethods=methods.length;
  final double[][][] timesAndResults=new double[numMethods][repeatStat][2];
  try {
    for (int k=0; k < repeatStat; k++) {
      for (int j=0; j < numMethods; j++) {
        if (runGC) {
          System.gc();
        }
        final Callable<Double> r=methods[j];
        final double[] result=new double[repeatChunk];
        final long start=System.nanoTime();
        for (int i=0; i < repeatChunk; i++) {
          result[i]=r.call().doubleValue();
        }
        final long stop=System.nanoTime();
        timesAndResults[j][k][0]=(stop - start) * NANO_TO_MILLI;
        timesAndResults[j][k][1]=result[rng.nextInt(repeatChunk)];
      }
    }
  }
 catch (  Exception e) {
    throw new MathIllegalStateException(LocalizedFormats.SIMPLE_MESSAGE,e.getMessage());
  }
  final double normFactor=1d / repeatChunk;
  for (int j=0; j < numMethods; j++) {
    for (int k=0; k < repeatStat; k++) {
      timesAndResults[j][k][0]*=normFactor;
    }
  }
  return timesAndResults;
}