void findStartEndPosition(Integer[] rotArr, Mutable<Integer> start,
			Mutable<Integer> end) {
		int lo = 0;
		int hi = rotArr.length - 1;

		// the array is sorted correctly. no break points.
		if (rotArr[lo] < rotArr[hi]) {
			start.setValue(lo);
			end.setValue(hi);
			return;
		}

		// binary search for the break point
		/*
		 * the size of the minimum subarray is 2. So, when this loop terminates,
		 * rotArr[lo] > rotArr[hi] and lo + 1 = high;
		 */
		while (lo + 1 < hi) {
			int mid = (lo + hi) / 2;
			if (rotArr[lo] > rotArr[mid]) {
				// The lower part has the break point.
				hi = mid;
			} else if (rotArr[lo] < rotArr[mid]) {
				// The higher part has the break point.
				lo = mid;
			} else {
				/*
				 * when rotArr[lo] == rotArr[mid] == rotArr[hi], we can not tell
				 * which part has the break point, check one element at a time
				 * instead.
				 */
				if (rotArr[lo] > rotArr[lo + 1]) {
					start.setValue(lo + 1); // check if lo is the break point.
					end.setValue(lo);
					return;
				}
				lo++;
			}
		}
		start.setValue(hi);
		end.setValue(lo);
	}