class CompositeDisposable implements Disposable, DisposableContainer {

    @Override
    public boolean add(@NonNull Disposable d) {
        ObjectHelper.requireNonNull(d, "d is null");
        if (!disposed) {
            synchronized (this) {
                if (!disposed) {
                    OpenHashSet<Disposable> set = resources;
                    if (set == null) {
                        set = new OpenHashSet<Disposable>();
                        resources = set;
                    }
                    set.add(d);
                    return true;
                }
            }
        }
        d.dispose();
        return false;
    }

    public  CompositeDisposable();
    public  CompositeDisposable(@NonNull Disposable... resources);
    public  CompositeDisposable(@NonNull Iterable<? extends Disposable> resources);

}