JavaCompletionProposal closeProposal= null;
IJavaCompletionProposal closeProposal= null;
	public void testOverrideCompletion2() 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.Writer;\n");		buf.append("\n");		buf.append("public class A extends Writer {\n" + 				"    public void foo() {\n" + 				"    }\n" + 				"    //here\n" + 				"}");		String contents= buf.toString();		ICompilationUnit cu= pack1.createCompilationUnit("A.java", contents, false, null);		String str= "//here";		int offset= contents.indexOf(str);		ResultCollector collector= new ResultCollector();		collector.reset(offset, cu.getJavaProject(), cu);		collector.setViewer(null);		collector.setReplacementLength(0);		collector.setPreventEating(true);		codeComplete(cu, offset, collector);		JavaCompletionProposal[] proposals= collector.getResults();		JavaCompletionProposal 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);		if (closeProposal instanceof OverrideCompletionProposal)			((OverrideCompletionProposal) closeProposal).setAnnotations(false);		closeProposal.apply(doc);		buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("\n");		buf.append("import java.io.IOException;\n");		buf.append("import java.io.Writer;\n");		buf.append("\n");		buf.append("public class A extends Writer {\n" + 				"    public void foo() {\n" + 				"    }\n" + 				"    /* (non-Javadoc)\n" + 				"     * @see java.io.Writer#close()\n" + 				"     */\n" + 				"    public void close() throws IOException {\n" + 				"        //TODO\n" + 				"        \n" + 				"    }//here\n" + 				"}");		assertEqualString(doc.get(), buf.toString());	}