public static String wrap(String input, Formatter formatter) throws FormatterException {
    return StringWrapper.wrap(Formatter.MAX_LINE_LENGTH, input, formatter);
  }
@Test
  public void testAwkwardLineEndWrapping() throws Exception {
    String input =
        lines(
            "class T {",
            // This is a wide line, but has to be split in code because of 100-char limit.
            "  String s = someMethodWithQuiteALongNameThatWillGetUsUpCloseToTheColumnLimit() "
                + "+ \"foo bar foo bar foo bar\";",
            "",
            "  String someMethodWithQuiteALongNameThatWillGetUsUpCloseToTheColumnLimit() {",
            "    return null;",
            "  }",
            "}");
    String output =
        lines(
            "class T {",
            "  String s =",
            "      someMethodWithQuiteALongNameThatWillGetUsUpCloseToTheColumnLimit()",
            "          + \"foo bar foo bar foo bar\";",
            "",
            "  String someMethodWithQuiteALongNameThatWillGetUsUpCloseToTheColumnLimit() {",
            "    return null;",
            "  }",
            "}");

    assertThat(StringWrapper.wrap(100, input, new Formatter())).isEqualTo(output);
  }