class BenjaminiHochberg implements MultipleTestingCorrection {

  @Override
  public void adjustPvals(List<? extends PValue> pvals) {
    Collections.sort(pvals);
    int N=pvals.size();
    for (int r=0;r<N;r++) {
      PValue item = pvals.get(r);
      double raw_p = item.getRawPValue();
      item.setAdjustedPValue(raw_p * N/(r+1));
    }
    enforcePValueMonotony(pvals);
  }

}