PsiExpression (PsiReferenceExpression reference, PsiElement block) { if (reference == null) { return null; } final PsiElement parent = ParenthesesUtils.getParentSkipParentheses(reference); if (!(parent instanceof PsiAssignmentExpression assignmentExpression)) { return null; } final IElementType tokenType = assignmentExpression.getOperationTokenType(); if (!JavaTokenType.EQ.equals(tokenType)) { return null; } final PsiExpression lExpression = PsiUtil.skipParenthesizedExprDown(assignmentExpression.getLExpression()); if (!reference.equals(lExpression)) { return null; } final PsiExpression rExpression = assignmentExpression.getRExpression(); if (PsiUtil.skipParenthesizedExprDown(rExpression) instanceof PsiAssignmentExpression) { return null; } final PsiElement grandParent = parent.getParent(); if (!(grandParent instanceof PsiExpressionStatement) || grandParent.getParent() != block) { return null; } return rExpression; }