void () { PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(file -> !"package-info.java".equals(file.getName()), getTestRootDisposable()); final PsiClass annotationTypeClass = findClass("annotations.AnnotationType"); assertTrue(annotationTypeClass.isAnnotationType()); final Collection<PsiMember> all = AnnotatedMembersSearch.search(annotationTypeClass, GlobalSearchScope.moduleScope(myModule)).findAll(); assertEquals(2, all.size()); Set<String> correctNames = new HashSet<>(Arrays.asList("AnnotatedClass", "correctMethod")); for (PsiMember member : all) { assertTrue(correctNames.contains(member.getName())); } final Collection<PsiPackage> packages = AnnotatedPackagesSearch.search(annotationTypeClass, GlobalSearchScope.moduleScope(myModule)).findAll(); assertEquals(1, packages.size()); assertEquals("annotated", packages.iterator().next().getQualifiedName()); tearDownLoadingFilter(); }