@Test
public void testJavaClassWithPackage() throws Exception {

   ScriptEngineManager mgr = new ScriptEngineManager();
   ScriptEngine engine = mgr.getEngineByExtension("java");
   Invocable inv = (Invocable) engine.eval( //
         "package here.is.the.packageName;\r\n" + //
               "import java.util.List;\r\n" + //
               "import org.unidal.helper.Splitters;\r\n" + //
               "public class P {\t\n" + //
               "public List<String> split(String source) { return Splitters.by('-').split(source); }\r\n" + //
               "}\r\n");
   Assert.assertEquals("[a, b, c, d, e]", inv.invokeFunction("split", "a-b-c-d-e").toString());
}