for (int i = 1; i < binCount - 1; i++) {
observed[i] = 0;
for (int j = binBounds.get(i - 1); j < binBounds.get(i); j++) {
observed[i] += frequency.getCount(j);
} // Expected count is (mass in [binBounds[i], binBounds[i+1])) * sampleSize
expected[i] = (poissonDistribution.cumulativeProbability(binBounds.get(i) - 1) -
poissonDistribution.cumulativeProbability(binBounds.get(i - 1) -1)) * sampleSize;
}
// Use chisquare test to verify that generated values are poisson(mean)-distributed
ChiSquareTest chiSquareTest = new ChiSquareTestImpl();