public Result checkSort(DefaultElement[] a, boolean checkStable) {
		for (int i = 1; i < a.length - 1; i++) {
			if (a[i].getKey() > a[i + 1].getKey()) {
				return Result.WRONG_ORDER;
			}
			if (checkStable && a[i].getKey() == a[i + 1].getKey()) {
				if (a[i].getInfo() >= a[i + 1].getInfo()) {
					return Result.NOT_STABLE;
				}
			}
		}
		return Result.OK;
	}