@Test(dataProvider = "test-file-provider") public void test(String source, String sourcePath) throws IOException { Path assertFilePath = Paths.get(resourceDirectory.toString(), sourcePath, ASSERT_DIR, source); Path sourceFilePath = Paths.get(resourceDirectory.toString(), sourcePath, SOURCE_DIR, source); String content = getSourceText(sourceFilePath); TextDocument textDocument = TextDocuments.from(content); SyntaxTree syntaxTree = SyntaxTree.from(textDocument); SyntaxTree newSyntaxTree = Formatter.format(syntaxTree); Assert.assertFalse(newSyntaxTree.hasDiagnostics()); Assert.assertEquals(newSyntaxTree.toSourceCode(), getSourceText(assertFilePath)); }
public static String format(String source) { return format(source, new FormattingOptions()); }
Formatter { public static String format(String source) { return format(source, new FormattingOptions()); } }
Formatter { public static String format(String source) { return format(source, new FormattingOptions()); }  }
Formatter { public static String format(String source) { return format(source, new FormattingOptions()); }  static String format(String source); static SyntaxTree format(SyntaxTree syntaxTree, LineRange range); static SyntaxTree format(SyntaxTree syntaxTree); static String format(String source, FormattingOptions options); static SyntaxTree format(SyntaxTree syntaxTree, LineRange range, FormattingOptions options); static SyntaxTree format(SyntaxTree syntaxTree, FormattingOptions options); }
Formatter { public static String format(String source) { return format(source, new FormattingOptions()); }  static String format(String source); static SyntaxTree format(SyntaxTree syntaxTree, LineRange range); static SyntaxTree format(SyntaxTree syntaxTree); static String format(String source, FormattingOptions options); static SyntaxTree format(SyntaxTree syntaxTree, LineRange range, FormattingOptions options); static SyntaxTree format(SyntaxTree syntaxTree, FormattingOptions options);  }