FunctionWriter implements ProcessorConstants, AngularConstants { void writeDependencies(Writer writer, String deco, String... dependencies) throws IOException { boolean first = true; for (String dependency : dependencies) { if (!first) { writer.append(COMMA).append(SPACEOPTIONAL); } writer.append(deco).append(dependency).append(deco); first = false; } }  void writeInjectDependenciesOnObject(Writer writer, String object, String... dependencies); void writeOpenFunctionWithDependencies(Writer writer, String object, String... dependencies); void writeCloseFunction(Writer writer);  }
@Test public void testWriteDependencies() throws Exception { System.out.println("writeDependencies"); Writer writer = new StringWriter(); instance.writeDependencies(writer, "'"); assertThat(writer.toString()).matches(""); writer = new StringWriter(); instance.writeDependencies(writer, "'", "dep1", "dep2"); assertThat(writer.toString()).matches("'dep1',\\s+'dep2'"); writer = new StringWriter(); instance.writeDependencies(writer, "'", "dep1"); assertThat(writer.toString()).matches("'dep1'"); writer = new StringWriter(); instance.writeDependencies(writer, "", "dep1"); assertThat(writer.toString()).matches("dep1"); }