public int indexOfKey(int key) {
        if (mGarbage) {
            gc();
        }

        return ContainerHelpers.binarySearch(mKeys, mSize, key);
    }
Returns the index for which {@link #keyAt} would return the
specified key, or a negative number if the specified
key is not mapped.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/collection/SparseArrayCompat.java