EngineHolder { public ScriptEngine getEngine() { if (engine == null) { this.engine = initEngine(this.factory, this.initScriptFiles); } return this.engine; } EngineHolder(final ScriptEngineFactory factory, final EngineConfiguration configuration); String getEngineName(); String getEngineVersion(); String getLanguageName(); ScriptEngine getEngine();  }
@Test @Ignore public void getEngineReset() throws Exception { EngineController controller = EngineController.getInstance(); EngineHolder holder = controller.getEngineByLanguageName("groovy"); ScriptEngine engine = holder.getEngine(); for (int iy = 0; iy < 10; iy++) { for (int ix = 1; ix < 100; ix++) { ScriptEngine sameEngine = holder.getEngine(); Assert.assertSame(engine, sameEngine); } ScriptEngine differentEngine = holder.getEngine(); Assert.assertNotSame(engine, differentEngine); engine = differentEngine; } }