static int binarySearch(int[] array, int size, int value) {
        int lo = 0;
        int hi = size - 1;

        while (lo <= hi) {
            int mid = (lo + hi) >>> 1;
            int midVal = array[mid];

            if (midVal < value) {
                lo = mid + 1;
            } else if (midVal > value) {
                hi = mid - 1;
            } else {
                return mid;  // value found
            }
        }
        return ~lo;  // value not present
    }
{@inheritDoc}

<p>This implementation composes a string by iterating over its mappings. If
this map contains itself as a key or a value, the string "(this Map)"
will appear in its place.
core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java