### Question:
DynamicProxyConfigGenerator { public static void main(String... args) { App app = new App(); int exitCode = new CommandLine(app).execute(args); if (app.exit) { System.exit(exitCode); } }  static void main(String... args); static String generateProxyConfig(CommandSpec[] specs, String[] interfaceClasses);  }### Answer:
@Test public void testMainStdOut() throws IOException { PrintStream old = System.out; ByteArrayOutputStream baos = new ByteArrayOutputStream(); System.setOut(new PrintStream(baos)); try { DynamicProxyConfigGenerator.main(ExampleInterface.class.getName()); } finally { System.setOut(old); } String expected = read("/example-interface-proxy.json"); expected = expected.replace("\r\n", "\n"); expected = expected.replace("\n", System.getProperty("line.separator")); assertEquals(expected, baos.toString()); }
@Test public void testMainOutputFile() throws IOException { File file = File.createTempFile("picocli-codegen", ".json"); DynamicProxyConfigGenerator.main("--output", file.getAbsolutePath(), ExampleInterface.class.getName()); String expected = read("/example-interface-proxy.json"); expected = expected.replace("\r\n", "\n"); expected = expected.replace("\n", System.getProperty("line.separator")); String actual = readAndClose(new FileInputStream(file)); file.delete(); assertEquals(expected, actual); }