public static <E extends Comparable<E>> int positionOfRotated(E[] array, E element) {
		if (array == null)
			return -1;
		
		int leftIndex = 0;
		int rightIndex = array.length - 1;
		int pivot;
		
		while (leftIndex <= rightIndex) {
			pivot = (rightIndex + leftIndex) / 2;
			
			if (element.compareTo(array[pivot]) == 0)
				return pivot;
			else if (array[pivot].compareTo(array[leftIndex]) > 0) { // left half strictly ascending
				if (element.compareTo(array[leftIndex]) >= 0 && element.compareTo(array[pivot]) < 0)
					rightIndex = pivot - 1;
				else 
					leftIndex = pivot + 1;
			} else { // right half strictly ascending
				if (element.compareTo(array[rightIndex]) <= 0 && element.compareTo(array[pivot]) > 0)
					leftIndex = pivot + 1;
				else
					rightIndex = pivot - 1;
			} 
		}
		
		return -1;
	}