private Object[] sort(Object[] automobiles, Method method, SortOrder sortOrder) {
		boolean sortedItem = false;
		for (int i = 0; i < automobiles.length - 1; i++) {

			Automobile first = (Automobile) automobiles[i];
			Automobile second = (Automobile) automobiles[i + 1];
			Comparable<Object> firstComparable = getVal(method, first);
			Comparable<Object> secondComparable = getVal(method, second);

			if (sortOrder == SortOrder.ASCENDING) {
				if (firstComparable.compareTo(secondComparable) > 0) {
					sortedItem = updateArray(automobiles, i, first, second);
				}
			} else {
				if (firstComparable.compareTo(secondComparable) < 0) {
					sortedItem = updateArray(automobiles, i, first, second);
				}
			}
		}
		if (sortedItem) {
			sort(automobiles, method, sortOrder);
		}
		return automobiles;
	}