Bug 102193 [Organize Imports] generic method problem
In Eclipse 3.1, if my code has the following line: Collections.<MyType>emptySet(); and I issue the Organize Imports command, MyType will be removed from the imports unless it is used elsewhere in that class.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
buf.append("        /*b*/HashMap map;\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*/");
		Region sel= new Region(start, 5);
		String[] order= new String[] { };
		int threshold= 99;
				
		ImportsStructure structure= new ImportsStructure(cu, order, threshold, true);
		OrganizeImportsOperation op= new OrganizeImportsOperation(structure, sel, true, true, null);
		op.run(null);
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("import java.util.Vector;\n");
		buf.append("import java.util.Map;\n");
		buf.append("public class A {\n");
		buf.append("    public void foo(Vector vec) {\n");
		buf.append("        /*b*/HashMap map;\n");
		buf.append("    }\n");
		buf.append("}\n");	
		assertEqualStringIgnoreDelim(cu.getSource(), buf.toString());
		
		sel= new Region(start, 9);
		
		structure= new ImportsStructure(cu, order, threshold, true);
		op= new OrganizeImportsOperation(structure, sel, true, true, null);
		op.run(null);
		buf= new StringBuffer();