RhsFunctions { public static void checkArgumentCount(RhsFunctionHandler handler, List<Symbol> arguments) throws RhsFunctionException { checkArgumentCount(handler.getName(), arguments, handler.getMinArguments(), handler.getMaxArguments()); } private  RhsFunctions(); static void checkArgumentCount(RhsFunctionHandler handler, 
                                          List<Symbol> arguments); static void checkArgumentCount(String name, List<Symbol> arguments, int min, int max); static void checkAllArgumentsAreNumeric(String name, List<Symbol> arguments);  }
@Test(expected=RhsFunctionException.class) public void testCheckArgumentCountThrowsExceptionWhenMinConstraintIsViolated() throws Exception { RhsFunctions.checkArgumentCount("test", Symbols.asList(syms, "a", "b", "c"), 4, Integer.MAX_VALUE); }
@Test(expected=RhsFunctionException.class) public void testCheckArgumentCountThrowsExceptionWhenMaxConstraintIsViolated() throws Exception { RhsFunctions.checkArgumentCount("test", Symbols.asList(syms, "a", "b", "c"), 0, 2); }
@Test(expected=RhsFunctionException.class) public void testCheckArgumentCountThrowsExceptionWhenExactConstraintIsViolated() throws Exception { RhsFunctions.checkArgumentCount("test", Symbols.asList(syms, "a", "b", "c"), 2, 2); }
@Test public void testCheckArgumentCountPasses() throws Exception { RhsFunctions.checkArgumentCount("test", Symbols.asList(syms, "a", "b", "c"), 1, 5); }