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 throwsFormatterException() throws Exception {
    try {
      new Formatter().formatSourceAndFixImports("package foo; public class {");
      fail();
    } catch (FormatterException expected) {
    }
  }