Bug 85831 Organize imports add an unused import [code manipulation]
Using I20050215-2300, run Organize import on this source: package test0069; class Outer<A> { class Inner<B> { } } public class X { test0069.Outer<String>.Inner<Integer> in = new Outer<String>().new Inner<Integer>(); } It adds import test0069.Outer.Inner; that is never used.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
buf.append("import java.net.ServerSocket;\n");
		buf.append("\n");
		buf.append("public class B {\n");
		buf.append("}\n");	
		
		assertEqualStringIgnoreDelim(cu2.getSource(), buf.toString());
		
	}
	
	
	public void testOrganizeImportOnRange() 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("import java.util.Vector;\n");
		buf.append("public class A {\n");
		buf.append("    public void foo(Vector vec) {\n");
		buf.append("        HashMap map;\n");
		buf.append("        /*b*/\n");
		buf.append("        Iterator iter= ((Collection) vec).iterator();\n");
		buf.append("        /*e*/\n");
		buf.append("    }\n");
		buf.append("}\n");	
		String content= buf.toString();
		ICompilationUnit cu= pack1.createCompilationUnit("A.java", content, false, null);
		int start= content.indexOf("/*b*/");
		int end= content.indexOf("/*e*/");