@Test public void toSortedSet_with_comparator() { LazyIterable<Integer> integers = this.newWith(2, 4, 4, 2, 1, 4, 1, 3); MutableSortedSet<Integer> set = integers.toSortedSet(Collections.<Integer>reverseOrder()); Verify.assertSortedSetsEqual( TreeSortedSet.newSetWith(Collections.<Integer>reverseOrder(), 1, 2, 3, 4), set); }
@Test public void toSortedSet() { LazyIterable<Integer> integers = this.newWith(2, 4, 1, 3, 2, 1, 3, 4); MutableSortedSet<Integer> set = integers.toSortedSet(); Verify.assertSortedSetsEqual(TreeSortedSet.newSetWith(1, 2, 3, 4), set); }