KotlinScriptEngineFactory implements ScriptEngineFactory { @Override public String getProgram(String... statements) { String sep = System.getProperty("line.separator"); StringBuilder bld = new StringBuilder(); for (String statement : statements) bld.append(statement).append(sep); return bld.toString(); }  @Override String getEngineName(); @Override String getEngineVersion(); @Override String getLanguageName(); @Override String getLanguageVersion(); @Override List<String> getNames(); @Override List<String> getMimeTypes(); @Override List<String> getExtensions(); @Override ScriptEngine getScriptEngine(); @Override Object getParameter(String key); @Override String getMethodCallSyntax(String obj, String m, String... args); @Override String getOutputStatement(String toDisplay); @Override String getProgram(String... statements);  }
@Test public void testGetProgram() { assertEquals("int c = a + b|float d = 42.0|", factory.getProgram("int c = a + b", "float d = 42.0") .replace(System.getProperty("line.separator"), '|' + "").trim()); }