hollow/src/main/java/com/netflix/hollow/core/memory/ThreadSafeBitSet.java
public ThreadSafeBitSet andNot(ThreadSafeBitSet other) {
        if(other.log2SegmentSize != log2SegmentSize)
            throw new IllegalArgumentException("Segment sizes must be the same");

        ThreadSafeBitSetSegments thisSegments = this.segments.get();
        ThreadSafeBitSetSegments otherSegments = other.segments.get();
        ThreadSafeBitSetSegments newSegments = new ThreadSafeBitSetSegments(thisSegments.numSegments(), numLongsPerSegment);

        for(int i=0;i<thisSegments.numSegments();i++) {
            AtomicLongArray thisArray = thisSegments.getSegment(i);
            AtomicLongArray otherArray = (i < otherSegments.numSegments()) ? otherSegments.getSegment(i) : null;
            AtomicLongArray newArray = newSegments.getSegment(i);

            for(int j=0;j<thisArray.length();j++) {
                long thisLong = thisArray.get(j);
                long otherLong = (otherArray == null) ? 0 : otherArray.get(j);

                newArray.set(j, thisLong & ~otherLong);
            }
        }

        ThreadSafeBitSet andNot = new ThreadSafeBitSet(log2SegmentSize);
        andNot.segments.set(newSegments);
        return andNot;
    }
public ThreadSafeBitSet andNot(ThreadSafeBitSet other) {
        if(other.log2SegmentSize != log2SegmentSize)
            throw new IllegalArgumentException("Segment sizes must be the same");

        ThreadSafeBitSetSegments thisSegments = this.segments.get();
        ThreadSafeBitSetSegments otherSegments = other.segments.get();
        ThreadSafeBitSetSegments newSegments = new ThreadSafeBitSetSegments(thisSegments.numSegments(), numLongsPerSegment);

        for(int i=0;i<thisSegments.numSegments();i++) {
            AtomicLongArray thisArray = thisSegments.getSegment(i);
            AtomicLongArray otherArray = (i < otherSegments.numSegments()) ? otherSegments.getSegment(i) : null;
            AtomicLongArray newArray = newSegments.getSegment(i);

            for(int j=0;j<thisArray.length();j++) {
                long thisLong = thisArray.get(j);
                long otherLong = (otherArray == null) ? 0 : otherArray.get(j);

                newArray.set(j, thisLong & ~otherLong);
            }
        }

        ThreadSafeBitSet andNot = new ThreadSafeBitSet(log2SegmentSize);
        andNot.segments.set(newSegments);
        return andNot;
    }
Return a new bit set which contains all bits which are contained in this bit set, and which are NOT contained in the <code>other</code> bit set.<p>

In other words, return a new bit set, which is a bitwise and with the bitwise not of the other bit set.

@param other the other bit set
@return the resulting bit set