public BigInteger getIndexAtOrAfter(Address addr) {
		int rangeIndex = Arrays.binarySearch(addressList, addr);
		if (rangeIndex >= 0) {
			return indexList[rangeIndex];
		}
		rangeIndex = -rangeIndex - 2;
		if (rangeIndex < 0) {
			return BigInteger.ZERO;
		}
		if (!(addr.getAddressSpace().equals(addressList[rangeIndex].getAddressSpace()))) {
			return indexList[rangeIndex + 1];
		}
		BigInteger offset =
			addr.getOffsetAsBigInteger().subtract(addressList[rangeIndex].getOffsetAsBigInteger());
		BigInteger index = indexList[rangeIndex].add(offset);

		if (index.compareTo(indexList[rangeIndex + 1]) >= 0) {
			return indexList[rangeIndex + 1];
		}
		return index;
	}
Returns the index for the given address.  If the address is not mapped, the result is
defined as follows:
   if the address is less than the smallest address in the map, then null is returned
   if the address is greater than the largest address in the map, then a value one bigger than
        the index of the largest address in the map.
   if the address is in a "gap", then the index of the next largest address that is in the
   		map is returned.

@param addr
           the address for which to retrieve the index.
@return the associated index for the given address or if there is none, then the index
        of then next address greater than the given address or null if there is none.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/util/AddressIndexMap.java