@Test
public void batchResponseUmlautsUtf8BodyAndHeader() throws Exception {

  List<ODataResponsePart> parts = new ArrayList<ODataResponsePart>();
  ODataResponse response = new ODataResponse();
  response.setStatusCode(HttpStatusCode.OK.getStatusCode());
  response.setHeader(HttpHeader.CONTENT_TYPE, ContentType.APPLICATION_JSON.toContentTypeString());
  response.setContent(IOUtils.toInputStream("{\"name\":\"Wälter Winter\"}" + CRLF));
  parts.add(new ODataResponsePart(Collections.singletonList(response), false));
  ODataResponse changeSetResponse = new ODataResponse();
  changeSetResponse.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
  changeSetResponse.setHeader(HttpHeader.CONTENT_ID, "1");
  changeSetResponse.setHeader("Custom-Header", "äüö");
  parts.add(new ODataResponsePart(Collections.singletonList(changeSetResponse), true));
  BatchResponseSerializer serializer = new BatchResponseSerializer();
  final InputStream content = serializer.serialize(parts, BOUNDARY);
  assertNotNull(content);
  final BatchLineReader reader = new BatchLineReader(content);
  final List<String> body = reader.toList();
  reader.close();
  assertEquals(25, body.size());
  // TODO: check: with latest change in BatchResponseSerializer is not possible
  // to set header values with UTF-8 (only iso-8859-1)
  //    assertEquals("Custom-Header: Ã¤Ã¼Ã¶" + CRLF, body.get(19));
  assertEquals("Custom-Header: äüö" + CRLF, body.get(19));
}