MoveInnerToTopRefactoring ref= MoveInnerToTopRefactoring.create(clas, JavaPreferencesSettings.getCodeGenerationSettings());
MoveInnerToTopRefactoring ref= MoveInnerToTopRefactoring.create(clas, JavaPreferencesSettings.getCodeGenerationSettings(clas.getJavaProject()));
	private void validatePassingTest(String parentClassName, String className, String packageName, String[] cuNames, String[] packageNames, String enclosingInstanceName, boolean makeFinal, boolean possible, boolean mandatory, boolean createFieldIfPossible) throws Exception {		IType parentClas= getClassFromTestFile(getPackage(packageName), parentClassName);		IType clas= parentClas.getType(className);				assertTrue("should be enabled", MoveInnerToTopRefactoring.isAvailable(clas));		MoveInnerToTopRefactoring ref= MoveInnerToTopRefactoring.create(clas, JavaPreferencesSettings.getCodeGenerationSettings());		RefactoringStatus preconditionResult= ref.checkInitialConditions(new NullProgressMonitor());		assertTrue("activation was supposed to be successful" + preconditionResult.toString(), preconditionResult.isOK());				assertEquals("reference creation possible", possible, ref.isCreatingInstanceFieldPossible());		assertEquals("reference creation mandatory", mandatory, ref.isCreatingInstanceFieldMandatory());		if (ref.isCreatingInstanceFieldPossible() && ! ref.isCreatingInstanceFieldMandatory())			ref.setCreateInstanceField(createFieldIfPossible);		if (enclosingInstanceName != null){			ref.setEnclosingInstanceName(enclosingInstanceName);			assertTrue("name should be ok ", ref.checkEnclosingInstanceName(enclosingInstanceName).isOK());		}			ref.setMarkInstanceFieldAsFinal(makeFinal);		ICompilationUnit[] cus= new ICompilationUnit[cuNames.length];		for (int i= 0; i < cuNames.length; i++) {			cus[i]= createCUfromTestFile(getPackage(packageNames[i]), cuNames[i]);					}				RefactoringStatus checkInputResult= ref.checkFinalConditions(new NullProgressMonitor());		assertTrue("precondition was supposed to pass", !checkInputResult.hasError());			performChange(ref, false);				for (int i= 0; i < cus.length; i++) {			String actual= cus[i].getSource();			String expected= getFileContents(getOutputTestFileName(cuNames[i]));			assertEqualLines(cus[i].getElementName(), expected, actual);		}		ICompilationUnit newCu= clas.getPackageFragment().getCompilationUnit(className + ".java");		String expected= getFileContents(getOutputTestFileName(className));		String actual= newCu.getSource();		assertEqualLines("new Cu:", expected, actual);	}