boolean (PsiElement element) { if (!(element instanceof PsiMethodCallExpression call1)) { return false; } final PsiExpression[] arguments = call1.getArgumentList().getExpressions(); if (arguments.length != 1) { return false; } final PsiExpression argument = PsiUtil.skipParenthesizedExprDown(arguments[0]); if (!(argument instanceof PsiMethodCallExpression call2)) { return false; } final PsiMethod setter = call1.resolveMethod(); final PsiMethod getter = call2.resolveMethod(); final PsiMethod get = PropertyUtil.getReversePropertyMethod(setter); final PsiMethod set = PropertyUtil.getReversePropertyMethod(getter); if (setter == null || getter == null || get == null || set == null) { return false; } //check types compatibility final PsiParameter[] parameters = setter.getParameterList().getParameters(); if (parameters.length != 1) { return false; } final PsiParameter parameter = parameters[0]; return parameter.getType().equals(getter.getReturnType()); }