private static boolean isEnhancedSelectorType(@NotNull PsiType type) {
    PsiPrimitiveType unboxedType = PsiPrimitiveType.getOptionallyUnboxedType(type);
    if (unboxedType != null &&
        (unboxedType.equals(PsiTypes.booleanType()) ||
         unboxedType.equals(PsiTypes.floatType()) ||
         unboxedType.equals(PsiTypes.doubleType()) ||
         unboxedType.equals(PsiTypes.longType()))) {
      return true;
    }
    if (TypeConversionUtil.getTypeRank(type) <= TypeConversionUtil.INT_RANK) return false;
    if (TypeConversionUtil.isPrimitiveAndNotNull(type)) return false;
    PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(type);
    if (psiClass != null) {
      if (psiClass.isEnum()) return false;
      String fqn = psiClass.getQualifiedName();
      if (Comparing.strEqual(fqn, CommonClassNames.JAVA_LANG_STRING)) return false;
    }
    return true;
  }
private static boolean isEnhancedSelectorType(@NotNull PsiType type)