docs: public static Type getReceiverType(ExpressionTree expressionTree) {
      if (expressionTree instanceof JCFieldAccess) {
        JCFieldAccess methodSelectFieldAccess = (JCFieldAccess) expressionTree;
        return methodSelectFieldAccess.selected.type;
      } else if (expressionTree instanceof JCIdent) {
        JCIdent methodCall = (JCIdent) expressionTree;
        return methodCall.sym.owner.type;
      } else if (expressionTree instanceof JCMethodInvocation) {
        return getReceiverType(((JCMethodInvocation) expressionTree).getMethodSelect());
      } else if (expressionTree instanceof JCMemberReference) {
        return ((JCMemberReference) expressionTree).getQualifierExpression().type;
      }
      throw new IllegalArgumentException(
          "Expected a JCFieldAccess or JCIdent from expression " + expressionTree);
    }