private int indexedSearch(List<WeightBucket<T>> list, WeightBucket<T> item) {
        int i = 0;
        for (; i < list.size(); i++) {
            Comparable midVal = list.get(i);
            int cmp = midVal.compareTo(item);
            if (cmp == 0) {// item等于中间值
                return i;
            } else if (cmp > 0) {// item比中间值小
                return i;
            } else if (cmp < 0) {// item比中间值大
                // next
            }
        }

        return i;
    }
private int indexedSearch ( List < WeightBucket < T > > list , WeightBucket < T > item ) { int i = 0 ; for ( ; i < list . size ( ) ; i ++ ) { Comparable midVal = list . get ( i ) ; int cmp = midVal . compareTo ( item ) ; if ( cmp == 0 ) { return i ; } else if ( cmp > 0 ) { return i ; } else if ( cmp < 0 ) { } } return i ; }
========================= helper method =====================