* Start with upper and lower tail bins.
* Lower bin = [0, lower); Upper bin = [upper, +inf).
*/
PoissonDistribution poissonDistribution = new PoissonDistribution(mean);
int lower = 1;
while (poissonDistribution.cumulativeProbability(lower - 1) * sampleSize < minExpectedCount) {
lower++;
}
int upper = (int) (5 * mean); // Even for mean = 1, not much mass beyond 5
while ((1 - poissonDistribution.cumulativeProbability(upper - 1)) * sampleSize < minExpectedCount) {
upper--;