function insertionIndexForObjectInListSortedByFunction(object, list, comparator, insertionIndexAfter)
{
    if (insertionIndexAfter)
        return list.upperBound(object, comparator);
    else
        return list.lowerBound(object, comparator);
}
@param {!T} object
@param {!Array.<!S>} list
@param {function(!T,!S):number=} comparator
@param {boolean=} insertionIndexAfter
@return {number}
@template T,S