public Main(PrintWriter outWriter, PrintWriter errWriter, InputStream inStream) {
    this.outWriter = outWriter;
    this.errWriter = errWriter;
    this.inStream = inStream;
  }
@Test
  public void testMain() throws Exception {
    Process process =
        new ProcessBuilder(
                ImmutableList.<String>builder()
                    .add(Paths.get(JAVA_HOME.value()).resolve("bin/java").toString())
                    .addAll(ADD_EXPORTS)
                    .add("-cp")
                    .add(JAVA_CLASS_PATH.value())
                    .add(Main.class.getName())
                    .build())
            .redirectError(Redirect.PIPE)
            .redirectOutput(Redirect.PIPE)
            .start();
    process.waitFor();
    String err = new String(ByteStreams.toByteArray(process.getErrorStream()), UTF_8);
    assertThat(err).contains("Usage: google-java-format");
    assertThat(process.exitValue()).isEqualTo(2);
  }