Bonferroni implements MultipleTestingCorrection { @Override public void adjustPvals(List<? extends PValue> pvals) { int N=pvals.size(); for (PValue item : pvals) { double p_raw= item.getRawPValue(); item.setAdjustedPValue(Math.min(1.0,N*p_raw)); } }  @Override void adjustPvals(List<? extends PValue> pvals); String getName();  }
@Test void testGet15Pvalues() { MultipleTestingCorrection bonf = new Bonferroni(); bonf.adjustPvals(pvallist); int expectedNumberOfPValues=15; assertEquals(expectedNumberOfPValues,pvallist.size()); }
@Test void testA() { MultipleTestingCorrection bonf = new Bonferroni(); bonf.adjustPvals(pvallist); double adjustedPValue = pvallist.get(0).getAdjustedPValue(); assertEquals(15*0.0001,adjustedPValue,EPSILON); }
@Test void testB() { MultipleTestingCorrection bonf = new Bonferroni(); bonf.adjustPvals(pvallist); double adjustedPValue = pvallist.get(1).getAdjustedPValue(); assertEquals(15*0.0004,adjustedPValue,EPSILON); }
@Test void testN() { MultipleTestingCorrection bonf = new Bonferroni(); bonf.adjustPvals(pvallist); double adjustedPValue = pvallist.get(14).getAdjustedPValue(); assertEquals(1.000,adjustedPValue,EPSILON); }