private void notifyCallbacks(T sender, int arg, A arg2, final int startIndex,
                                 final int endIndex, final long bits) {
        long bitMask = 1;
        for (int i = startIndex; i < endIndex; i++) {
            if ((bits & bitMask) == 0) {
                mNotifier.onNotifyCallback(mCallbacks.get(i), sender, arg, arg2);
            }
            bitMask <<= 1;
        }
    }
Notify callbacks from startIndex to endIndex, using bits as the bit status
for whether they have been removed or not. bits should be from mRemainderRemoved or
mFirst64Removed. bits set to 0 indicates that all callbacks from startIndex to
endIndex should be notified.

@param sender     The originator. This is an opaque parameter passed to
                  {@link CallbackRegistry.NotifierCallback#onNotifyCallback(Object, Object, int, Object)}
@param arg        An opaque parameter passed to
                  {@link CallbackRegistry.NotifierCallback#onNotifyCallback(Object, Object, int, Object)}
@param arg2       An opaque parameter passed to
                  {@link CallbackRegistry.NotifierCallback#onNotifyCallback(Object, Object, int, Object)}
@param startIndex The index into the mCallbacks to start notifying.
@param endIndex   One past the last index into mCallbacks to notify.
@param bits       A bit field indicating which callbacks have been removed and shouldn't
                  be notified.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/obs/CallbackRegistry.java