class SW360ReleaseClientAdapterAsyncImpl implements SW360ReleaseClientAdapterAsync {

    @Override
    public CompletableFuture<Optional<SW360SparseRelease>> getSparseReleaseByExternalIds(Map<String, ?> externalIds) {
        return getReleaseClient().getReleasesByExternalIds(externalIds)
                .thenApply(releases -> {
                    if (releases.isEmpty()) {
                        return Optional.empty();
                    } else if (releases.size() == 1) {
                        return Optional.of(releases.get(0));
                    } else {
                        throw new SW360ClientException("Multiple releases in SW360 matched by externalIDs: " +
                                externalIds);
                    }
                });
    }

    public  SW360ReleaseClientAdapterAsyncImpl(SW360ReleaseClient client,
                                              SW360ComponentClientAdapterAsync componentClientAdapter);

}