boolean (@Nullable PsiMethod method) { if (method == null) return false; if (method.isConstructor()) return false; String methodName = method.getName(); if (!isSetterName(methodName)) return false; if (method.getParameterList().getParametersCount() != 1) { return false; } final PsiType returnType = method.getReturnType(); if (returnType == null || PsiTypes.voidType().equals(returnType)) { return true; } return Comparing.equal(PsiUtil.resolveClassInType(TypeConversionUtil.erasure(returnType)), method.getContainingClass()); }