IterableUtils { public static <K extends Comparable> List<K> sortedListCopy(final Iterable<? extends K> iterable) { checkNotNull(iterable); final List<K> list = listCopy(iterable); Collections.sort(list); return list; } private  IterableUtils(); static boolean isEmpty(final Iterable<? super K> iterable); static List<K> listCopy(final Iterable<? extends K> iterable); static List<K> sortedListCopy(final Iterable<? extends K> iterable); static List<K> sortedReversedListCopy(final Iterable<? extends K> iterable); static List<K> sortedListCopy(final Iterable<? extends K> iterable,
                                             final Comparator<? super K> comparator); static List<K> sortedReversedListCopy(final Iterable<? extends K> iterable,
                                                     final Comparator<? super K> comparator); static int size(final Iterable<? extends K> iterable);  }
@Test public void testSortedListCopy() throws Exception { assumeTrue("Expected that Iterable and List are same instance", iterable == backedList); final List<Integer> copy = IterableUtils.sortedListCopy(iterable); assertThat(copy, hasSize(backedList.size())); assertThat(copy, contains(backedList.get(1), backedList.get(2), backedList.get(0))); }