Bug 127704 [clean up] 'Remove unnecessary casts' should work for nested casts
I20060214-0010 Clean up only removes one of the unnecessary casts: boolean m() { return (boolean) (Boolean) Boolean.TRUE; }
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
}
	
	public static void assertNumberOfProblems(CompilationUnit unit, int expected) {
		IProblem[] problems= unit.getProblems();
		if (problems.length != expected) {
			StringBuffer buf= new StringBuffer();
			buf.append("Wrong number of problems, is: ").append(problems.length). append(", expected: ").append(expected).append('\n');
			for (int i= 0; i < problems.length; i++) {
				buf.append(" - ").append(problems[i].getMessage()).append('\n');
			}
			assertTrue(buf.toString(), false);
		}
	}
	
	private CompilationUnit[] compile(ICompilationUnit[] units) {
		CompilationUnit[] result= new CompilationUnit[units.length];
		for (int i= 0; i < units.length; i++) {
			result[i]= compile(units[i]);
		}
		return result;
	}
	
	private CompilationUnit compile(ICompilationUnit compilationUnit) {
		CompilationUnit result= JavaPlugin.getDefault().getASTProvider().getAST(compilationUnit, ASTProvider.WAIT_YES, null);
		if (result == null) {
			
			result= ASTResolving.createQuickFixAST(compilationUnit, null);
		}
		return result;
	}