public int format(String... args) throws UsageException {
    CommandLineOptions parameters = processArgs(args);
    if (parameters.version()) {
      errWriter.println(versionString());
      return 0;
    }
    if (parameters.help()) {
      throw new UsageException();
    }

    JavaFormatterOptions options =
        JavaFormatterOptions.builder()
            .style(parameters.aosp() ? Style.AOSP : Style.GOOGLE)
            .formatJavadoc(parameters.formatJavadoc())
            .build();

    if (parameters.stdin()) {
      return formatStdin(parameters, options);
    } else {
      return formatFiles(parameters, options);
    }
  }
@Test
  public void noReflowLongStrings() throws Exception {
    String[] input = {
      "class T {", //
      "  String s = \"one long incredibly unbroken sentence moving from topic to topic so that no"
          + " one had a chance to interrupt\";",
      "}"
    };
    String[] expected = {
      "class T {",
      "  String s =",
      "      \"one long incredibly unbroken sentence moving from topic to topic so that no one had"
          + " a chance to interrupt\";",
      "}",
      "",
    };
    InputStream in = new ByteArrayInputStream(joiner.join(input).getBytes(UTF_8));
    StringWriter out = new StringWriter();
    Main main =
        new Main(
            new PrintWriter(out, true),
            new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.err, UTF_8)), true),
            in);
    assertThat(main.format("--skip-reflowing-long-strings", "-")).isEqualTo(0);
    assertThat(out.toString()).isEqualTo(joiner.join(expected));
  }