String formatted= CodeFormatterUtil.format(CodeFormatterUtil.K_COMPILATION_UNIT, contents, 0, positions, "\n", null);
String formatted= CodeFormatterUtil.format(CodeFormatter.K_COMPILATION_UNIT, contents, 0, positions, "\n", null);
	public void testCUWithPos() throws Exception {		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class A {\n");		buf.append("    public void foo() {\n");		buf.append("    Runnable run= new Runnable() {};\n");		buf.append("    }\n");		buf.append("}\n");		String contents= buf.toString();				String word1= "new";		int start1= contents.indexOf(word1);		int[] positions= { start1, start1 + word1.length() - 1};				String formatted= CodeFormatterUtil.format(CodeFormatterUtil.K_COMPILATION_UNIT, contents, 0, positions, "\n", null);		buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class A {\n");		buf.append("    public void foo() {\n");		buf.append("        Runnable run = new Runnable() {\n");		buf.append("        };\n");			buf.append("    }\n");		buf.append("}\n");		String expected= buf.toString();		assertEqualString(formatted, expected);				String curr1= formatted.substring(positions[0], positions[1] + 1);		assertEqualString(curr1, word1);	}	