void () { String className = CommonClassNames.JAVA_LANG_STRING; PsiClass clsClass = JavaPsiFacade.getInstance(getProject()).findClass(className, GlobalSearchScope.allScope(getProject())); assertNotNull(clsClass); assertInstanceOf(clsClass, PsiCompiledElement.class); assertEquals(className, clsClass.getQualifiedName()); PsiClass psiClass = (PsiClass)clsClass.getNavigationElement(); assertNotNull(psiClass); assertFalse(psiClass instanceof PsiCompiledElement); assertEquals(className, psiClass.getQualifiedName()); String fieldName = "CASE_INSENSITIVE_ORDER"; PsiField clsField = clsClass.findFieldByName(fieldName, false); assertNotNull(clsField); assertInstanceOf(clsField, PsiCompiledElement.class); assertEquals(fieldName, clsField.getName()); PsiField psiField = (PsiField)clsField.getNavigationElement(); assertNotNull(psiField); assertFalse(psiField instanceof PsiCompiledElement); assertEquals(fieldName, psiField.getName()); String methodName = "equalsIgnoreCase"; PsiMethod[] methods = clsClass.findMethodsByName(methodName, false); assertEquals(1, methods.length); PsiMethod clsMethod = methods[0]; assertInstanceOf(clsMethod, PsiCompiledElement.class); assertEquals(methodName, clsMethod.getName()); PsiMethod psiMethod = (PsiMethod)clsMethod.getNavigationElement(); assertNotNull(psiMethod); assertFalse(psiMethod instanceof PsiCompiledElement); assertEquals(methodName, psiMethod.getName()); PsiParameter[] clsParameters = clsMethod.getParameterList().getParameters(); assertEquals(1, clsParameters.length); PsiParameter clsParameter = clsParameters[0]; assertInstanceOf(clsParameter, PsiCompiledElement.class); PsiParameter psiParameter = (PsiParameter)clsParameter.getNavigationElement(); assertNotNull(psiParameter); assertFalse(psiParameter instanceof PsiCompiledElement); assertEquals(clsParameter.getName(), psiParameter.getName()); PsiParameter[] psiParameters = psiMethod.getParameterList().getParameters(); assertSame(psiParameters[0], psiParameter); }