@Override
    public boolean retainAll(@NonNull Collection<?> collection) {
        boolean removed = false;
        for (int i = mSize - 1; i >= 0; i--) {
            if (!collection.contains(mArray[i])) {
                removeAt(i);
                removed = true;
            }
        }
        return removed;
    }
Remove all values in the array set that do <b>not</b> exist in the given collection.

@param collection The collection whose contents are to be used to determine which
                  values to keep.
@return Returns true if any values were removed from the array set, else false.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/collection/ArraySet.java