type= (IType) resultArray[0];
if (resultArray != null && resultArray.length > 0) type= (IType) resultArray[0];
	private IType chooseClassToTestType() {		IPackageFragmentRoot root= getPackageFragmentRoot();		if (root == null) 			return null;		IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() };		IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);				IType type= null;		try {			SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, null);			dialog.setTitle(Messages.getString("NewTestClassWizPage.class_to_test.dialog.title")); //$NON-NLS-1$			dialog.setMessage(Messages.getString("NewTestClassWizPage.class_to_test.dialog.message")); //$NON-NLS-1$			dialog.open();			if (dialog.getReturnCode() != SelectionDialog.OK)				return type;			else {				Object[] resultArray= dialog.getResult();				type= (IType) resultArray[0];			}		} catch (JavaModelException e) {			JUnitPlugin.log(e);		}		return type;	}