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/ScopeAnalyzerTest.java
assertMethods(res, new String[] { "goo"}, true);
		}
		
		{
			String str= "return 1;";
			int offset= buf.toString().indexOf(str);
	
			int flags= ScopeAnalyzer.METHODS;
			IBinding[] res= new ScopeAnalyzer(astRoot).getDeclarationsInScope(offset, flags);
			
			assertMethods(res, new String[] { "foo", "goo"}, true);
		}		
	}
	
	
	private static final String[] OBJ_METHODS= new String[] { "getClass", 
		"hashCode", "equals", "clone", "toString", "notify", "notifyAll", "wait", "wait",
		"wait", "finalize" };
	private void assertMethods(IBinding[] res, String[] expectedNames, boolean addObjectMethods) {
		String[] names= new String[res.length];		
		for (int i= 0; i < res.length; i++) {
			names[i]= res[i].getName();
		}
		String[] expected= expectedNames;
		
		if (addObjectMethods) {
			expected= new String[expectedNames.length + OBJ_METHODS.length];
			System.arraycopy(OBJ_METHODS, 0, expected, 0, OBJ_METHODS.length);
			System.arraycopy(expectedNames, 0, expected, OBJ_METHODS.length, expectedNames.length);
		}