private static boolean isConstantOfType(PsiElement element, PsiPrimitiveType... types) {
    if (!(element instanceof PsiReferenceExpression ref) || !(ref.resolve() instanceof PsiField field)) return false;
    PsiModifierList modifierList = field.getModifierList();
    if (modifierList == null ||
        !modifierList.hasModifierProperty(PsiModifier.STATIC) ||
        !modifierList.hasModifierProperty(PsiModifier.FINAL)) {
      return false;
    }
    if (!ArrayUtil.contains(field.getType(), types)) return false;
    return field.hasInitializer() && PsiUtil.isConstantExpression(field.getInitializer());
  }
private static boolean isConstantOfType(PsiElement element, PsiPrimitiveType... types)