### Question:
Function { public final String checkNrOfArgsAndExecute (String[] args) { if (args.length != mNrOfParams) { throw new ExecutionException ("function '%s' needs %d arguments, got %d", getName (), mNrOfParams, args.length); } return execute (args); } Function(String name, int nrOfParameters); static void setRunTime(RunTime runTime); final String getName(); final int getNrOfParameters(); final String checkNrOfArgsAndExecute(String[] args); abstract String execute(String[] args);  }### Answer:
@Test public void testTooFewArguments () { try { new MyFunction ().checkNrOfArgsAndExecute (new String[] { }); fail ("no exception"); } catch (ExecutionException ee) { } }
@Test public void testTooManyArguments () { try { new MyFunction ().checkNrOfArgsAndExecute (new String[] { "x", "y"}); fail ("no exception"); } catch (ExecutionException ee) { } }