private static ImmutableSortedSet copyOfInternal(Comparator comparator1, Iterable iterable) { if (SortedIterables.hasSameComparator(comparator1, iterable) && (iterable instanceof ImmutableSortedSet)) { ImmutableSortedSet immutablesortedset = (ImmutableSortedSet) iterable; if (!immutablesortedset.isPartialView()) return immutablesortedset; } ImmutableList immutablelist = ImmutableList.copyOf(SortedIterables.sortedUnique(comparator1, iterable)); Object obj; if (immutablelist.isEmpty()) obj = emptySet(comparator1); else obj = new RegularImmutableSortedSet(immutablelist, comparator1); return ((ImmutableSortedSet) (obj)); }
public ImmutableSortedSet build() { return ImmutableSortedSet.copyOfInternal(comparator, super.contents.iterator()); }