CombinatoricsUtils { public static void checkBinomial(final int n, final int k) throws NumberIsTooLargeException, NotPositiveException { if (n < k) { throw new NumberIsTooLargeException(LocalizedFormats.BINOMIAL_INVALID_PARAMETERS_ORDER, k, n, true); } if (n < 0) { throw new NotPositiveException(LocalizedFormats.BINOMIAL_NEGATIVE_PARAMETER, n); } } private  CombinatoricsUtils(); static long binomialCoefficient(final int n, final int k); static double binomialCoefficientDouble(final int n, final int k); static double binomialCoefficientLog(final int n, final int k); static long factorial(final int n); static double factorialDouble(final int n); static double factorialLog(final int n); static long stirlingS2(final int n, final int k); static Iterator<int[]> combinationsIterator(int n, int k); static void checkBinomial(final int n,
                                     final int k);  }
@Test(expected=NotPositiveException.class) public void testCheckBinomial1() { CombinatoricsUtils.checkBinomial(-1, -2); }
@Test(expected=NumberIsTooLargeException.class) public void testCheckBinomial2() { CombinatoricsUtils.checkBinomial(4, 5); }
@Test public void testCheckBinomial3() { CombinatoricsUtils.checkBinomial(5, 4); }