class SW360ReleaseClientAdapterAsyncImpl implements SW360ReleaseClientAdapterAsync {

    @Override
    public CompletableFuture<SW360Release> createRelease(SW360Release release) {
        return FutureUtils.wrapInFuture(() -> {
            if (release.getId() != null) {
                throw new IllegalArgumentException("Release already has the id " + release.getId());
            }
            return SW360ReleaseAdapterUtils.validateRelease(release);
        }, "Cannot create release for " + release.getName())
                .thenCompose(this::assignReleaseToComponent)
                .thenCompose(getReleaseClient()::createRelease);
    }

    public  SW360ReleaseClientAdapterAsyncImpl(SW360ReleaseClient client,
                                              SW360ComponentClientAdapterAsync componentClientAdapter);

}