class AccessTokenProvider {

    public <T> CompletableFuture<T> doWithToken(Function<? super AccessToken, ? extends CompletableFuture<T>> func) {
        return obtainAccessToken()
                .thenCompose(token -> func.apply(token)
                        .whenComplete((result, exception) -> onRequestComplete(token, exception)));
    }

    public  AccessTokenProvider(SW360AuthenticationClient authClient);

}