class AuthorizedRequestFactory implements RequestFactory {

    @Override
    public Request createRequest(URI uri, String method) throws IOException {
        final Request request = delegate.createRequest(uri, method);
        request.getHeaders().put(Headers.AUTHORIZATION, authorizationProvider.getAuthorizationHeader());
        return request;
    }

      AuthorizedRequestFactory(final RequestFactory delegate, final AuthorizationProvider authorizationProvider);

}