private static int binarySearch(final int[] data, final int value) {
        /** Define lowest search point. **/
        int low = 0;
        /** Define highest search point. **/
        int high = data.length - 1;

        /** While lowest search point is less or equal to the highest. **/
        while (low <= high) {
            /** Calculate a useful mid point. **/
            final int mid = low + (high - low) / 2;

            /** If mid point contains correct value then return location. **/
            if (data[mid] == value) {
                return mid;

            } else if (data[mid] < value) {
                /**
                 * Value is greater than mid point, so search the highest side
                 * of the array.
                 **/
                low = mid + 1;

            } else {
                /**
                 * Value is smaller than mid point, so search the lowest side
                 * of the array.
                 **/
                high = mid - 1;
            }

            mIterations++;
        }
        return -1;
    }