private void reportMutabilityViolation(boolean receiver, @NotNull PsiElement anchor) {
    if (receiver) {
      if (anchor instanceof PsiMethodReferenceExpression methodRef) {
        anchor = methodRef.getReferenceNameElement();
      }
      else if (anchor instanceof PsiMethodCallExpression call) {
        anchor = call.getMethodExpression().getReferenceNameElement();
      }
      if (anchor != null) {
        myReceiverMutabilityViolation.add(anchor);
      }
    }
    else {
      myArgumentMutabilityViolation.add(anchor);
    }
  }
private void reportMutabilityViolation(boolean receiver, @NotNull PsiElement anchor)