@Override
	public List<Action> getActions(List<T> values) {
		setup(values);
		pinned = -1;
		opened = new BitSet(values.size());

		int iMin;
		for (int j = 0; j < n - 1; j++) {
			iMin = j;
			for (int i = j + 1; i < n; i++) {
				actionOpen(iMin, i);
				if (a.get(i).compareTo(a.get(iMin)) < 0) {
					iMin = i;
				}
				actionPin(iMin);
			}
			if (iMin != j) {
				T tmp = a.get(j);
				a.set(j, a.get(iMin));
				a.set(iMin, tmp);
				actionOpen(j, iMin);
				actionSwap(iMin, j);
			}
			actionUnpin();
		}

		DEBUGLOG.fine("SelectionSort sorted the values " + values);
		assert isListSorted(a);
		return actions;
	}