code: public <T> T getHeader(String name, Class<T> type) {
      return (T) headers.get(name);
    }
docs: Get a header value casting to expected type.
  
  @param name Name of header
  @param type Expected type of header's value
  @param <T> Expected type of header's value
  @return Value of header