anchor.diff:      if (core.hasBody) {
         if (core.hasBodyString) {
           _bodyStr = core.bodyStr();
  -        _body = _SimulatedResponseBody.string;
  +        _body = SimulatedResponseBodyType.string;
         } else if (core.hasBodyBytes) {
           _bodyBytes = core.bodyBytes();
  -        _body = _SimulatedResponseBody.bytes;
  +        _body = SimulatedResponseBodyType.bytes;
         } else {
           throw StateError('core has neither bytes or string body');
         }
       } else {
  -      _body = _SimulatedResponseBody.none;
  +      _body = SimulatedResponseBodyType.none;
       }
     }
   
  
positive.code:   //
    // When there is no body (e.g. with a redirect response), both are null.
  
    late final _SimulatedResponseBody _body;
  
    late final String? _bodyStr; // store complete body
  
  
negative.code:   //----------------------------------------------------------------
    /// Retrieves the body as a String.
    ///
    /// If the source format of the body is a String, it is returned and the
    /// _encoding_ is not used.
    ///
    /// If the source format of the body is a sequence of bytes, it is converted
    /// to a String using the decoder of the [encoding]. Note: if the _encoding_
    /// is `utf8`, this method may throw a [FormatException] when the bytes
    /// do not represent a valid UTF-8 encoded code point.
    ///
    /// If there is no source for the body, returns the empty string.
    ///
    /// **Related methods**
    ///
    /// Use [bodyBytes] to retrieve the body as a sequence of bytes.
    ///
    /// Use [bodyStr] as a shorthand for invoking this method with the [utf8]
    /// encoding.
    ///
    /// If retrieving the String to only see if it is empty, use [bodyIsEmpty]
    /// instead (which works more efficiently if the body had been set to
    /// a sequence of bytes, since it doesn't need to decode them).
  
    String bodyString(Encoding encoding) {
      switch (_body) {
        case SimulatedResponseBodyType.none:
          return ''; // empty String
        case SimulatedResponseBodyType.bytes:
          return encoding.decode(_bodyBytes!);
        case SimulatedResponseBodyType.string:
          return _bodyStr!;
      }
    }
  
    //----------------------------------------------------------------
    /// Retrieves the body as a sequence of bytes.
    ///
    /// If the source format of the body is a sequence of bytes, it is returned
    /// and the _encoding_ is not used.
    ///
    /// If the source format of the body is a String, it is converted to a
    /// sequence of bytes using the encoder of the [encoding].
    ///
    /// If there is no source for the body, returns an empty list.
    ///
    /// **Related methods**
    ///
    /// Use [bodyStr] or [bodyString] to retrieve the body as a String.
    ///
    /// If retrieving the bytes to only see if they are empty, use [bodyIsEmpty]
    /// instead (which works more efficiently if the body had been set to a
    /// String, since it doesn't need to encode it).
  
    List<int> bodyBytes(Encoding encoding) {
      switch (_body) {
        case SimulatedResponseBodyType.none:
          return <int>[]; // empty list of bytes
        case SimulatedResponseBodyType.bytes:
          return _bodyBytes!;
        case SimulatedResponseBodyType.string:
          return encoding.encode(_bodyStr!);
      }
    }
  
    //----------------------------------------------------------------
    /// Indicates if there is a body has content or not.
    ///
    /// Returns true if the body is non-empty (i.e. has been set to more than one
    /// byte or a string with one or more characters).
    ///
    /// Returns true if the body has not been set, or has been set to zero bytes
    /// or an empty string.
  
    bool get bodyIsEmpty {
      switch (_body) {
        case SimulatedResponseBodyType.none:
          return true;
        case SimulatedResponseBodyType.bytes:
          final b = _bodyBytes;
          return b == null || b.isEmpty;
        case SimulatedResponseBodyType.string:
          final s = _bodyStr;
          return s == null || s.isEmpty;
      }
    }
  
  