Convert spring data Sort to Ebean OrderBy.

@param sort
@param <T>
@return
195967
public static <T> OrderBy<T> convertToEbeanOrderBy(Sort sort) {
        if (sort == null) {
            return null;
        }
        List<String> list = new ArrayList<>();

        Iterator<Sort.Order> orderIterator = sort.iterator();
        while (orderIterator.hasNext()) {
            Sort.Order so = orderIterator.next();
            list.add(so.getProperty() + " " + so.getDirection());
        }
        return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list));
    }
1120989
public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) {
		FieldType fieldType = verifyColumnName(columnName);
		if (fieldType.isForeignCollection()) {
			throw new IllegalArgumentException("Can't orderBy foreign collection field: " + columnName);
		}
		addOrderBy(new OrderBy(columnName, ascending));
		return this;
	}
1194621
@Nonnull
  public Query orderBy(@Nonnull FieldPath fieldPath) {
    return orderBy(fieldPath, Direction.ASCENDING);
  }
98524
@Nonnull
  public Query orderBy(@Nonnull String field) {
    return orderBy(FieldPath.fromDotSeparatedString(field), Direction.ASCENDING);
  }
589092
SortPropertyOrder convert2SortPropertyOrder(final SortOrder order) {
		switch (order) {
		case ASCENDING:
			return SortPropertyOrder.ASCENDING;
		case DESCENDING:
			return SortPropertyOrder.DESCENDING;
		default:
			throw new IllegalArgumentException("Unknown SortOrder: " + order);
		}
	}
1046076
public List<Order> create(OrderBy order) {
        List<Order> list = new ArrayList<>();

        for (SortSpecification sort : order.getSort()) {
            if (sort.getSortOrder() == SortOrder.DESC) {
                list.add(cb.desc(root.get(sort.getKey())));
            } else if (sort.getSortOrder() == SortOrder.ASC) {
                list.add(cb.asc(root.get(sort.getKey())));
            }
        }

        return list;
    }
754601
public static Boolean isAscendingOrder(String sorting) {
        return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE;
    }
12874
protected void appendSort(SolrQuery solrQuery, @Nullable Sort sort, @Nullable Class<?> domainType) {

		if (sort == null) {
			return;
		}

		for (Order order : sort) {
			solrQuery.addSort(getMappedFieldName(order.getProperty(), domainType),
					order.isAscending() ? ORDER.asc : ORDER.desc);
		}
	}
57304
@SafeVarargs
    public static <V extends Comparable<V>> V[] sort(V... array) {
        Arrays.sort(array);
        return array;
    }
383028
public function orderBy(string $sort, string $order = 'ASC'): self
    {
        $order = 'ASC' === strtoupper($order) ? 'ASC' : 'DESC';
        $this->orderBy = [$sort => $order];
        return $this;
    }
604550
public static <T> List<T> sort(List<T> list, Comparator<? super T> c) {
		Collections.sort(list, c);
		return list;
	}
807383
public static <T extends Comparable<? super T>, L extends List<T>> L sortThis(L list)
    {
        if (list instanceof MutableList<?>)
        {
            ((MutableList<T>) list).sortThis();
        }
        else if (list instanceof ArrayList)
        {
            ArrayListIterate.sortThis((ArrayList<T>) list);
        }
        else
        {
            if (list.size() > 1)
            {
                Collections.sort(list);
            }
        }
        return list;
    }
837046
private void buildOrderBy(final StringBuilder orderByBuilder, final Map<String, SortDirection> sorts) {
        boolean isFirst = true;
        String querySortDirection;

        for (final Map.Entry<String, SortDirection> sort : sorts.entrySet()) {
            if (isFirst) {
                orderByBuilder.append(" ORDER BY ");
                isFirst = false;
            } else {
                orderByBuilder.append(", ");
            }

            if (sort.getValue().equals(SortDirection.ASCENDING)) {
                querySortDirection = "ASC";
            } else {
                querySortDirection = "DESC";
            }
            orderByBuilder.append(sort.getKey()).append(" ").append(querySortDirection);
        }
    }
26042
public static Expression<?> orderBy(List<OrderSpecifier<?>> args) {
        return operation(Object.class, Ops.ORDER, ConstantImpl.create(args));
    }
32469
public static <T extends Extendable> List<T> sortAndGroup(final List<T> values, final Group[] groups, final Sort sort, final boolean ascending) {
        List<T> list = sort(values, sort, ascending);
        list = group(list, groups);
        return list;
    }
1050580
public static Sort sort(Sort... sort) {
        if (sort.length == 1) {
            return sort[0];
        } else {
            Sort s = new Sort(true);
            for (Sort x : sort) {
                ((ArrayNode) s.node).add(x.toJson());
            }
            return s;
        }
    }
700340
public static <E extends Comparable<E>> void sort(List<E> list) {
        while(!Sort.isSorted(list)) {
            FYShuffle.shuffle(list);
        }
    }