public String formatSourceAndFixImports(String input) throws FormatterException {
    input = ImportOrderer.reorderImports(input, options.style());
    input = RemoveUnusedImports.removeUnusedImports(input);
    String formatted = formatSource(input);
    formatted = StringWrapper.wrap(formatted, this);
    return formatted;
  }
@Test
  public void importsFixedIfRequested() throws FormatterException {
    String input =
        "package com.google.example;\n"
            + UNORDERED_IMPORTS
            + "\npublic class ExampleTest {\n"
            + "  @Nullable List<?> xs;\n"
            + "}\n";
    String output = new Formatter().formatSourceAndFixImports(input);
    String expect =
        "package com.google.example;\n\n"
            + "import java.util.List;\n"
            + "import javax.annotation.Nullable;\n\n"
            + "public class ExampleTest {\n"
            + "  @Nullable List<?> xs;\n"
            + "}\n";
    assertThat(output).isEqualTo(expect);
  }