@Test public void testGetProgram() { JShellScriptEngineFactory factory = new JShellScriptEngineFactory(); assertThat(factory.getProgram()).isEqualTo(""); assertThat(factory.getProgram("alpha")).isEqualTo("alpha;\n"); assertThat(factory.getProgram("alpha", "beta")).isEqualTo("alpha;\nbeta;\n"); }
@Override public String getProgram(String... statements) { StringBuilder s = new StringBuilder(); for(String statement : statements) { s.append(statement); s.append(";\n"); } return s.toString(); }
JShellScriptEngineFactory implements ScriptEngineFactory { @Override public String getProgram(String... statements) { StringBuilder s = new StringBuilder(); for(String statement : statements) { s.append(statement); s.append(";\n"); } return s.toString(); } }
JShellScriptEngineFactory implements ScriptEngineFactory { @Override public String getProgram(String... statements) { StringBuilder s = new StringBuilder(); for(String statement : statements) { s.append(statement); s.append(";\n"); } return s.toString(); }  }
JShellScriptEngineFactory implements ScriptEngineFactory { @Override public String getProgram(String... statements) { StringBuilder s = new StringBuilder(); for(String statement : statements) { s.append(statement); s.append(";\n"); } return s.toString(); }  @Override String getEngineName(); @Override String getEngineVersion(); @Override List<String> getExtensions(); @Override List<String> getMimeTypes(); @Override List<String> getNames(); @Override String getLanguageName(); @Override String getLanguageVersion(); @Override Object getParameter(String key); @Override String getMethodCallSyntax(String obj, String method, String... args); @Override String getOutputStatement(String toDisplay); @Override String getProgram(String... statements); @Override ScriptEngine getScriptEngine(); }
JShellScriptEngineFactory implements ScriptEngineFactory { @Override public String getProgram(String... statements) { StringBuilder s = new StringBuilder(); for(String statement : statements) { s.append(statement); s.append(";\n"); } return s.toString(); }  @Override String getEngineName(); @Override String getEngineVersion(); @Override List<String> getExtensions(); @Override List<String> getMimeTypes(); @Override List<String> getNames(); @Override String getLanguageName(); @Override String getLanguageVersion(); @Override Object getParameter(String key); @Override String getMethodCallSyntax(String obj, String method, String... args); @Override String getOutputStatement(String toDisplay); @Override String getProgram(String... statements); @Override ScriptEngine getScriptEngine();  }