public void formatSource(CharSource input, CharSink output)
      throws FormatterException, IOException {
    // TODO(cushon): proper support for streaming input/output. Input may
    // not be feasible (parsing) but output should be easier.
    output.write(formatSource(input.read()));
  }
@Test
  public void removeTrailingTabsInComments() throws Exception {
    assertThat(
            new Formatter()
                .formatSource(
                    "class Foo {\n"
                        + "  void f() {\n"
                        + "    int x = 0; // comment\t\t\t\n"
                        + "    return;\n"
                        + "  }\n"
                        + "}\n"))
        .isEqualTo(
            "class Foo {\n"
                + "  void f() {\n"
                + "    int x = 0; // comment\n"
                + "    return;\n"
                + "  }\n"
                + "}\n");
  }