class FutureUtils {

    public static <T> T block(CompletableFuture<? extends T> future) {
        try {
            return HttpUtils.waitFor(future);
        } catch (IOException e) {
            if (e.getCause() instanceof SW360ClientException) {
                throw (SW360ClientException) e.getCause();
            }
            throw new SW360ClientException("Asynchronous call failed.", e);
        }
    }

    private  FutureUtils();

}