ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview= proposal.getCompilationUnitChange().getPreviewContent();  buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("    public void foo() {\n"); buf.append(" buf.append("    }\n"); buf.append("}\n"); assertEqualString(preview, buf.toString());
boolean addReturnType= true, doRename= true;  for (int i= 0; i < proposals.size(); i++) { Object elem= proposals.get(i); if (elem instanceof ASTRewriteCorrectionProposal) { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) elem; assertTrue("duplicated entries", addReturnType); addReturnType= false;  String preview= proposal.getCompilationUnitChange().getPreviewContent();  buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("    public void foo() {\n"); buf.append(" buf.append("    }\n"); buf.append("}\n"); assertEqualString(preview, buf.toString()); } else { assertTrue("duplicated entries", doRename); doRename= false;  CUCorrectionProposal proposal= (CUCorrectionProposal) elem; String preview= proposal.getCompilationUnitChange().getPreviewContent(); buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("    public E() {\n"); buf.append(" buf.append("    }\n"); buf.append("}\n"); assertEqualString(preview, buf.toString()); } }
	public void testVoidTypeReturnDeclMissing() throws Exception {		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class E {\n");		buf.append("    public foo() {\n");		buf.append("        //do nothing\n");		buf.append("    }\n");		buf.append("}\n");		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);				CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);		IProblem[] problems= astRoot.getProblems();		assertNumberOf("problems", problems.length, 1);				ProblemPosition problemPos= new ProblemPosition(problems[0], cu);		ArrayList proposals= new ArrayList();				JavaCorrectionProcessor.collectCorrections(problemPos,  proposals);		assertNumberOf("proposals", proposals.size(), 1);		assertCorrectLabels(proposals);				ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0);		String preview= proposal.getCompilationUnitChange().getPreviewContent();		buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class E {\n");		buf.append("    public void foo() {\n");		buf.append("        //do nothing\n");		buf.append("    }\n");		buf.append("}\n");		assertEqualString(preview, buf.toString());	}