@Test
public void testWriteErrorResponseHeaders() throws Exception {

  MockHttpServletResponse response = new MockHttpServletResponse();
  ServletResponseResultWriter writer = new ServletResponseResultWriter(response, null);
  Map<String, String> headers = new LinkedHashMap<>();
  headers.put("name0", "value0");
  headers.put("name1", "value1");
  writer.writeError(new UnauthorizedException("message", "schema", headers));
  assertEquals("schema name0=value0, name1=value1", response.getHeader("WWW-Authenticate"));
}