@Override public <THeader> ServiceResponseWithHeaders<T, THeader> buildEmptyWithHeaders(final Response<Void> response, Class<THeader> headerType) throws IOException { ServiceResponse<T> bodyResponse = buildEmpty(response); THeader headers = serializerAdapter.deserialize( serializerAdapter.serialize(Maps.asMap(response.headers().names(), new Function<String, String>() { @Override public String apply(String s) { return response.headers().get(s); } })), headerType); ServiceResponseWithHeaders<T, THeader> serviceResponse = new ServiceResponseWithHeaders<>(headers, bodyResponse.headResponse()); serviceResponse.withBody(bodyResponse.body()); return serviceResponse; }