public static int[] findMinMax(int[] sorted, int min, int max) {
		int[] minMax = new int[2];
		if (min < sorted[0]) {
			minMax[0] = sorted[0];
		} else {
			minMax[0] = binarySearch(sorted, min, 0, sorted.length, 0);
		}
		if (max > sorted[sorted.length - 1]) {
			minMax[1] = sorted[sorted.length - 1];
		} else {
			minMax[1] = binarySearch(sorted, max, 0, sorted.length, 1);
		}
		return minMax;
	}