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
pack0.createCompilationUnit("Test1.java", buf.toString(), false, null);
		IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null);
		buf= new StringBuffer();
		buf.append("package pack1;\n");
		buf.append("\n");
		buf.append("import pack0.Test1;\n");
		buf.append("import java.util.List;\n");
		buf.append("\n");
		buf.append("public class Test2 extends Test1 {\n");
		buf.append("	public void testMe() {\n");
		buf.append("	    assertNotEquals(\"A\", \"B\", \"C\");\n");
		buf.append("	}\n");
		buf.append("}\n");
		ICompilationUnit cu= pack1.createCompilationUnit("Test2.java", buf.toString(), false, null);
		String[] order= new String[] {};
		IChooseImportQuery query= createQuery("MyClass", new String[] {}, new int[] {});
		OrganizeImportsOperation op= new OrganizeImportsOperation(cu, order, 99, false, true, true, query);
		op.run(null);
		buf= new StringBuffer();
		buf.append("package pack1;\n");
		buf.append("\n");
		buf.append("import pack0.Test1;\n"); 
		buf.append("\n");
		buf.append("public class Test2 extends Test1 {\n");
		buf.append("	public void testMe() {\n");
		buf.append("	    assertNotEquals(\"A\", \"B\", \"C\");\n");
		buf.append("	}\n");
		buf.append("}\n");
		assertEqualString(cu.getSource(), buf.toString());
	}