### Question:
JSRhinoScriptEngine implements IScriptEngine { @Override public Object execFunc (String funcName, Object... args) { return ScriptableObject.callMethod(this.cx, this.scope, funcName, args); } JSRhinoScriptEngine(); @Override void compile(String scriptName, String programStr); @Override void loadFile(File file); @Override Object execFunc(String funcName, Object... args); @Override Object execFunc(String funcName); @Override Object execScript(String scriptName, Object... args); @Override void shutdown();  }### Answer:
@Test (expected = EcmaError.class) public void testExecNotExistentFunc () throws ScriptLoadException { JSRhinoScriptEngine engine = new JSRhinoScriptEngine(); engine.execFunc("test1"); }
@Test public void testExecFunc () throws ScriptLoadException { JSRhinoScriptEngine engine = new JSRhinoScriptEngine(); engine.compile("test", "function test(a) { return 2 * a; } "); engine.execScript("test", null); Object obj = engine.execFunc("test", 8); assertNotNull(obj); assertEquals(16d, obj); }