CompletionProposalCollector collector= new CompletionProposalCollector(cu);
CompletionProposalCollector collector= createCollector(cu, offset);
	public void testOverrideCompletion3() throws Exception {		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");		IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("\n");		buf.append("import java.io.BufferedWriter;\n");		buf.append("\n");		buf.append("public class A extends BufferedWriter {\n");		buf.append("    public void foo() {\n");		buf.append("    }\n");		buf.append("    //here\n");		buf.append("}\n");		String contents= buf.toString();		ICompilationUnit cu= pack1.createCompilationUnit("A.java", contents, false, null);		String str= "//here";		int offset= contents.indexOf(str);		CompletionProposalCollector collector= new CompletionProposalCollector(cu);		collector.setReplacementLength(0);		codeComplete(cu, offset, collector);		IJavaCompletionProposal[] proposals= collector.getJavaCompletionProposals();		IJavaCompletionProposal closeProposal= null;		for (int i= 0; i < proposals.length; i++) {			if (proposals[i].getDisplayString().startsWith("close()")) {				closeProposal= proposals[i];			}		}		assertNotNull("no proposal for close()", closeProposal);		IDocument doc= new Document(contents);		closeProposal.apply(doc);		buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("\n");		buf.append("import java.io.BufferedWriter;\n");		buf.append("import java.io.IOException;\n");		buf.append("\n");		buf.append("public class A extends BufferedWriter {\n");		buf.append("    public void foo() {\n");		buf.append("    }\n");		buf.append("    /* (non-Javadoc)\n");		buf.append("     * @see java.io.BufferedWriter#close()\n");		buf.append("     */\n");		buf.append("    @Override\n");		buf.append("    public void close() throws IOException {\n");		buf.append("        //TODO\n");		buf.append("        super.close();\n");		buf.append("    }//here\n");		buf.append("}\n");		assertEqualString(doc.get(), buf.toString());	}