HttpResponse { @NonNull public Result<String> getBodyString() { try { return success(new String(body, getHeaderFieldValue(CONTENT_TYPE) .ifSucceededAttemptMap(CHARSET_FROM_CONTENT_TYPE) .orElse(DEFAULT_CHARSET))); } catch (final UnsupportedEncodingException e) { return failure(e); } } private  HttpResponse(final int responseCode, @NonNull final String responseMessage,
      @NonNull final Map<String, String> header, @NonNull final byte[] body); @NonNull static HttpResponse httpResponse(final int responseCode,
      @NonNull final String responseMessage,
      @NonNull final Map<String, String> header, @NonNull final byte[] body); @NonNull byte[] getBody(); @NonNull Result<String> getBodyString(); int getResponseCode(); @NonNull String getResponseMessage(); @NonNull Result<String> getHeaderFieldValue(@NonNull final String field); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldGetSuccessBodyStringForSuccess() throws Throwable { assertThat(successfulHttpResponse.getBodyString().get(), is(BODY_STRING)); }