@SuppressWarnings("unchecked")
    public int insertSorted (T value, Comparator<? super T> comp)
    {
        int ipos = binarySearch(value, comp);
        if (ipos < 0) {
            ipos = -(ipos+1);
        }
        _elements = (T[])ListUtil.insert(_elements, ipos, value);
        _size++;
        return ipos;
    }
@ SuppressWarnings ( "unchecked" ) public int insertSorted ( T value , Comparator < ? super T > comp ) { int ipos = binarySearch ( value , comp ) ; if ( ipos < 0 ) { ipos = - ( ipos + 1 ) ; } _elements = ( T [ ] ) ListUtil . insert ( _elements , ipos , value ) ; _size ++ ; return ipos ; }
Inserts the specified item into the list into a position that
preserves the sorting of the list according to the supplied {@link
Comparator}. The list must be sorted (via the supplied comparator)
prior to the call to this method (an empty list built up entirely
via calls to {@link #insertSorted} will be properly sorted).

@return the index at which the element was inserted.