final int n = testvalues.length; // number of trials
final CumulativeBinomialDistribution cumbinomdist = new CumulativeBinomialDistribution(p,n);
for (int i=0;i<testvalues.length;i++) {
final double expected = testvalues[i];
final double realised = cumbinomdist.op(i); // i = number of successful events
final double tolerance = 1.0e-11;
if (Math.abs(expected-realised)>tolerance) {
fail("x: " + i + " expected: " + expected + " realised: " + realised);
}
}