class SpringmvcConsumerResponseMapper implements ConsumerResponseMapper {

  @Override
  public Object mapResponse(Response response) {
    HttpStatus status = HttpStatus.valueOf(response.getStatusCode());

    Map<String, List<Object>> headers = response.getHeaders().getHeaderMap();
    if (headers == null) {
      Object realResult = realMapper.mapResponse(response);
      return new ResponseEntity<>(realResult, null, status);
    }

    HttpHeaders httpHeaders = new HttpHeaders();
    for (Entry<String, List<Object>> entry : headers.entrySet()) {
      if (entry.getValue() == null) {
        continue;
      }

      for (Object value : entry.getValue()) {
        if (value != null) {
          httpHeaders.add(entry.getKey(), String.valueOf(value));
        }
      }
    }

    Object realResult = realMapper.mapResponse(response);
    return new ResponseEntity<>(realResult, httpHeaders, status);
  }

  public  SpringmvcConsumerResponseMapper(ConsumerResponseMapper realMapper);

}