### Question:
Randomizer { public static int poissonValue(double mean) { if (mean<100){ return poissonSmall(mean); } else{ return poissonLarge(mean); } }  static int poissonValue(double mean); static double gaussianValue(double mean, double sigma); static void addMixedGaussianPoissonNoise(String gaussSigma, String gaussMean); static void addMixedGaussianPoissonNoise(double gaussSigma, double gaussMean); static void addMixedGaussianPoissonNoise(ImagePlus imp, double gaussSigma, double gaussMean); static void addMixedGaussianPoissonNoise(ImageProcessor ip, double gaussSigma, double gaussMean); static void addGaussianNoise(ImagePlus imp, double gaussSigma, double gaussMean); static void addGaussianNoise(ImageProcessor ip, double gaussSigma, double gaussMean); static void addsCMOSNoise(ImagePlus imp, ImagePlus sCMOSFPN); static void addPoissonNoise(ImageProcessor ip); static void FPNGainOffset(ImageProcessor ip, ImagePlus sCMOSFPN); static Random random; }### Answer:
@Test public void testRandomizer() throws Exception{ double mean = 80; int sampleSize = 10000; float[] randomNumbers = new float[sampleSize]; for(int i = 0; i < randomNumbers.length; i++){ randomNumbers[i] = (float) Randomizer.poissonValue(mean); } float Sum = 0; float Sum2 = 0; float Ave; float Var; for(int i = 0; i < randomNumbers.length; i++){ Sum += randomNumbers[i]; Sum2 += randomNumbers[i] * randomNumbers[i]; } Ave = Sum / ((float)sampleSize); Var = (Sum2 - Sum*Sum/((float)sampleSize))/((float)sampleSize - 1); System.out.println(Ave); System.out.println(Var); }