private int mergeComputeMinRun(int n) {
        int r = 0;      /* becomes 1 if any 1 bits are shifted off */
        while (n >= MIN_SIZE) {
            r |= (n & 1);
            n >>= 1;
        }
        return n + r;
    }
returns the minimum run length for merging

see http://svn.python.org/projects/python/trunk/Objects/listobject.c
almost exact copy of merge_compute_minrun function

If n &lt; MIN_SIZE, return n (it's too small to bother with fancy stuff).
Else if n is an exact power of 2, return MIN_SIZE / 2. Else return an int
k, MIN_SIZE / 2 &lt;= k &lt;= MIN_SIZE , such that n/k is close to, but
strictly less than, an exact power of 2.

@param n length of the array
@return the minimum run length for
jme3-core/src/main/java/com/jme3/util/ListSort.java