@Override
	public T[] get(Long index) {
		// adjust to 1-based.
		index++;

		// parse the index to {n-1, n-2, ... 3, 2, 1, 0}-based number.
		// For example, 10 = {1, 1, 1, 1, 0}. The meaning of each digits is the
		// number of digits on the left greater than current digit. For example,
		// in object list {a, b, d, c, e}, The corresponding index = {0, 0, 1,
		// 0, 0}. Because c has d on the left.
		Integer[] permArr = new Integer[n];
		for (int i = n - 1; i >= 0; i--) {
			permArr[i] = (int) ((index % (n - i)));
			index /= n - i;
		}

		// keep objList2 as a reference.
		T[] objList2 = Arrays.copyOf(objList, n);

		for (int objIdx = 0; objIdx < n; objIdx++) {
			int pos = 0;

			// get current object obj and find its current position in the
			// object list.
			T obj = objList2[objIdx];
			for (int i = 0; i < n; i++) {
				if (obj.equals(objList[i])) {
					pos = i;
					break;
				}
			}

			// the number of objects in reversed order (objects on the left and
			// greater than current object.)
			int revOrd = permArr[objIdx];
			for (int i = 0; i < n; i++) {
				// no object in reversed order. done.
				if (revOrd <= 0) {
					break;
				}

				// pass if the objects in list are smaller than current obj
				if (obj.compareTo(objList[i]) >= 0) {
					continue;
				}

				// move to larger objects to the left to fulfill "revOrd" number
				// of objects in reversed order.
				if (i > pos) {
					objList[pos] = objList[i];
					pos = i;
				}
				revOrd--;
				if (revOrd <= 0) {
					// put obj back for the last one
					objList[pos] = obj;
					break;
				}
			}
		}
		return objList;
	}