anchor.diff:    //----------------------------------------------------------------
     /// Retrieves the body as a String.
     ///
  -  /// The empty string is returned if there is no body.
  -  ///
  -  /// If the body is a sequence of bytes, it is converted to a string using
  -  /// the decoder of the [encoding]. If the _encoding_ is `utf8`, this method
  -  /// may throw a [FormatException] if the body contains a sequence of bytes
  -  /// that do not represent a UTF-8 encoded code point.
  +  /// 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 _SimulatedResponseBody.none:
  -        return '';
  -      case _SimulatedResponseBody.bytes:
  +      case SimulatedResponseBodyType.none:
  +        return ''; // empty String
  +      case SimulatedResponseBodyType.bytes:
           return encoding.decode(_bodyBytes!);
  -      case _SimulatedResponseBody.string:
  +      case SimulatedResponseBodyType.string:
           return _bodyStr!;
       }
     }
   
     //----------------------------------------------------------------
  -  /// Retrieves the body as a list of bytes.
  -  ///
  -  /// The empty list is returned if there is no body.
  -  ///
  -  /// If the handler produced a String value, the UTF-8 encoding of that
  -  /// value is returned.
  -  ///
  -  /// Use [bodyStr] to retrieve the body as a String.
  -
  -  List<int> bodyBytes([Encoding enc = utf8]) {
  +  /// 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 _SimulatedResponseBody.none:
  +      case SimulatedResponseBodyType.none:
           return <int>[]; // empty list of bytes
  -      case _SimulatedResponseBody.bytes:
  +      case SimulatedResponseBodyType.bytes:
           return _bodyBytes!;
  -      case _SimulatedResponseBody.string:
  -        return enc.encode(_bodyStr!);
  +      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;
       }
     }
   
  
positive.code: /// This class extends [Response] with methods to retrieve the body of the
  /// HTTP response. The other response classes (used by request handlers to
  /// produce HTTP responses) only allow the body to be produced.
  
  class SimulatedResponse extends Response {
    //================================================================
  
negative.code:     if (core.hasBody) {
        if (core.hasBodyString) {
          _bodyStr = core.bodyStr();
          _body = SimulatedResponseBodyType.string;
        } else if (core.hasBodyBytes) {
          _bodyBytes = core.bodyBytes();
          _body = SimulatedResponseBodyType.bytes;
        } else {
          throw StateError('core has neither bytes or string body');
        }
      } else {
        _body = SimulatedResponseBodyType.none;
      }
    }
  
  