Returns a mutable list containing elements sorted by this ordering; use this only when the resulting list may need further modification, or may contain null. The input is not modified. The returned list is serializable and has random access. Unlike {@link Sets#newTreeSet(I
(Iterable<E> elements)
| 876 | */ |
| 877 | |
| 878 | @CanIgnoreReturnValue // TODO(kak): Consider removing this |
| 879 | public <E extends T> List<E> sortedCopy(Iterable<E> elements) { |
| 880 | @SuppressWarnings("unchecked") // does not escape, and contains only E's |
| 881 | E[] array = (E[]) Iterables.toArray(elements); |
| 882 | Arrays.sort(array, this); |
| 883 | return Lists.newArrayList(Arrays.asList(array)); |
| 884 | } |
| 885 | |
| 886 | /** |
| 887 | * Returns an <b>immutable</b> list containing {@code elements} sorted by this |
no test coverage detected