buf.append("    private Iterator fIterator;\n");
buf.append("    private Iterator iterator;\n");
	public void testAssignToLocal2() throws Exception {		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("import java.util.Vector;\n");				buf.append("public class E {\n");		buf.append("    public Vector goo() {\n");		buf.append("        return null;\n");		buf.append("    }\n");				buf.append("    public void foo() {\n");		buf.append("        goo().iterator();\n");		buf.append("    }\n");		buf.append("}\n");		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);						int offset= buf.toString().indexOf("goo().iterator()");		CorrectionContext context= getCorrectionContext(cu, offset, 0);		assertCorrectContext(context);		ArrayList proposals= new ArrayList();				JavaCorrectionProcessor.collectCorrections(context,  proposals);		assertNumberOf("proposals", proposals.size(), 3);		assertCorrectLabels(proposals);		boolean doField= true, doLocal= true;		for (int i= 0; i < proposals.size(); i++) {			Object curr= proposals.get(i);			if (!(curr instanceof AssignToVariableAssistProposal)) {				continue;			}						AssignToVariableAssistProposal proposal= (AssignToVariableAssistProposal) curr;			if (proposal.getVariableKind() == AssignToVariableAssistProposal.FIELD) {				assertTrue("same proposal kind", doField);				doField= false;				String preview= proposal.getCompilationUnitChange().getPreviewContent();						buf= new StringBuffer();				buf.append("package test1;\n");				buf.append("import java.util.Iterator;\n");				buf.append("import java.util.Vector;\n");								buf.append("public class E {\n");				buf.append("    private Iterator fIterator;\n");					buf.append("    public Vector goo() {\n");				buf.append("        return null;\n");				buf.append("    }\n");						buf.append("    public void foo() {\n");				buf.append("        fIterator = goo().iterator();\n");				buf.append("    }\n");				buf.append("}\n");				assertEqualString(preview, buf.toString());								Point selection= proposal.getSelection(new Document(preview));				assertEquals("wrong selection", "fIterator", preview.substring(selection.x, selection.x + selection.y));				} else if (proposal.getVariableKind() == AssignToVariableAssistProposal.LOCAL) {				assertTrue("same proposal kind", doLocal);				doLocal= false;				String preview= proposal.getCompilationUnitChange().getPreviewContent();						buf= new StringBuffer();				buf.append("package test1;\n");				buf.append("import java.util.Iterator;\n");				buf.append("import java.util.Vector;\n");								buf.append("public class E {\n");				buf.append("    public Vector goo() {\n");				buf.append("        return null;\n");				buf.append("    }\n");						buf.append("    public void foo() {\n");				buf.append("        Iterator iterator = goo().iterator();\n");				buf.append("    }\n");				buf.append("}\n");				assertEqualString(preview, buf.toString());				Point selection= proposal.getSelection(new Document(preview));				assertEquals("wrong selection", "iterator", preview.substring(selection.x, selection.x + selection.y));				}		}	}