boolean (@NotNull DeclarationKind kind) { return switch (kind) { case CLASS -> myFilter.isClassAcceptable(PsiClass.class); case FIELD -> myFilter.isClassAcceptable(PsiField.class); case METHOD -> myFilter.isClassAcceptable(PsiMethod.class); case PACKAGE -> myFilter.isClassAcceptable(PsiPackage.class); case VARIABLE -> myFilter.isClassAcceptable(PsiVariable.class); case ENUM_CONST -> myFilter.isClassAcceptable(PsiEnumConstant.class); }; }