public static <E extends Comparable<E>> int positionOf(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)
				leftIndex = pivot + 1;
			else if (element.compareTo(array[pivot]) < 0)
				rightIndex = pivot - 1;
			else // element.compareTo(array[pivot]) == 0
				return pivot;
		}
		
		return -1;
	}