class SW360Assert {

    public static <T> void assertIdsUnset(Collection<T> collection, Function<? super T, Boolean> idSetExtractor) throws SW360Exception {
        if (!collection.stream().noneMatch(el -> {
            return idSetExtractor.apply(el);
        })) {
            throw fail("ID already set, cannot add to database!");
        }
    }

    private  SW360Assert();

}