@Nullable
    public static PsiMethod findEqualsMethod(PsiClass clazz) {
        PsiMethod[] methods = clazz.findMethodsByName("equals", false);

        // is it public boolean equals(Object o)
        for (PsiMethod method : methods) {
            // must be public
            if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
                continue;
            }

            // must not be static
            if (method.hasModifierProperty(PsiModifier.STATIC)) {
                continue;
            }

            // must have boolean as return type
            PsiType returnType = method.getReturnType();
            if (!PsiTypes.booleanType().equals(returnType)) {
                continue;
            }

            // must have one parameter
            PsiParameter[] parameters = method.getParameterList().getParameters();
            if (parameters.length != 1) {
                continue;
            }

            // parameter must be Object
            if (!(parameters[0].getType().getCanonicalText().equals(JAVA_LANG_OBJECT))) {
                continue;
            }

            // equals method found
            return method;
        }

        // equals not found
        return null;
    }
@Nullable
    public static PsiMethod findEqualsMethod(PsiClass clazz)