ScriptBuilder implements Statement, AcceptsStatementVisitor { public ScriptBuilder addStatement(Statement statement) { statements.add(checkNotNull(statement, "statement")); return this; }  ScriptBuilder addStatement(Statement statement); ScriptBuilder unsetEnvironmentVariable(String name); ScriptBuilder addEnvironmentVariableScope(String scopeName, Map<String, String> variables); static Statement forget(String instanceName, String script, String logDir); static Statement findPid(String pid); static Statement call(String fn, String... args); @Override String render(OsFamily osFamily); static void writeFunctions(Map<String, String> functionsToWrite, OsFamily osFamily, StringBuilder builder); @VisibleForTesting static Map<String, String> resolveFunctionDependenciesForStatements(Map<String, String> knownFunctions,
         Iterable<Statement> statements, final OsFamily osFamily); @Override Iterable<String> functionDependencies(OsFamily family); @Override void accept(StatementVisitor visitor);  }
@Test public void testSwitchOn() { ScriptBuilder builder = new ScriptBuilder(); builder.addStatement(switchArg(1, ImmutableMap.of("start", interpret("echo started{lf}"), "stop", interpret("echo stopped{lf}")))); assertEquals(builder.statements, ImmutableList.of(new SwitchArg(1, ImmutableMap.of("start", interpret("echo started{lf}"), "stop", interpret("echo stopped{lf}"))))); }