@Test public void toSortedSetWithComparator() { ImmutableCollection<Integer> integers = this.classUnderTest(); MutableSortedSet<Integer> set = integers.toSortedSet(Comparators.<Integer>reverseNaturalOrder()); Assert.assertEquals(integers.toSet(), set); Assert.assertEquals( integers.toSortedList(Comparators.<Integer>reverseNaturalOrder()), set.toList()); }
@Test public void toSortedSet() { ImmutableCollection<Integer> integers = this.classUnderTest(); MutableSortedSet<Integer> set = integers.toSortedSet(); Verify.assertListsEqual(integers.toSortedList(), set.toList()); }