Creates an unmodifiable view of a SortedSet.

@param self a SortedSet
@return an unmodifiable view of the SortedSet
@see java.util.Collections#unmodifiableSortedSet(java.util.SortedSet)
@see #asUnmodifiable(java.util.List)
@since 2.5.0
11846
public static <T> SortedSet<T> asUnmodifiable(SortedSet<T> self) {
        return Collections.unmodifiableSortedSet(self);
    }
1187086
public Set<Map.Entry<K,V>> entrySet ()
    {
        // no modifying except through put() and remove()
        return Collections.unmodifiableSet(_delegate.entrySet());
    }
159418
public static <T> SortedSet<T> asSynchronized(SortedSet<T> self) {
        return Collections.synchronizedSortedSet(self);
    }
734939
public static <K, V> Map<K, V> toSorted(SortedMap<K, V> self) {
        return new LinkedHashMap<K, V>(self);
    }
1051204
public static <K, V> Map<K, V> collectEntries(Iterator<?> self) {
        return collectEntries(self, Closure.IDENTITY);
    }
1046969
@Inline(value="$2.$3unmodifiableMap($1)", imported=Collections.class)
	public static <K, V> Map<K, V> unmodifiableView(Map<? extends K, ? extends V> map) {
		return Collections.unmodifiableMap(map);
	}
956681
public static MutableComboBoxModel leftShift(MutableComboBoxModel self, Object i) {
        self.addElement(i);
        return self;
    }
691077
public static <T> T max(Iterator<T> self) {
        return max((Iterable<T>)toList(self));
    }
517577
public static <T> SortedSet<T> minus(SortedSet<T> self, Object removeMe) {
        return (SortedSet<T>) minus((Set<T>) self, removeMe);
    }
128906
public static Iterator iterator(final MutableComboBoxModel self) {
        return new Iterator() {
            private int index = 0;

            public boolean hasNext() {
                return index > -1 && index < self.getSize();
            }

            public Object next() {
                return self.getElementAt(index++);
            }

            public void remove() {
                if (hasNext()) self.removeElementAt(index--);
            }
        };
    }
1099761
public static <T> Set<T> toImmutableSet(final Set<? extends T> set) {
    switch (set.size()) {
      case 0:
        return Collections.emptySet();
      case 1:
        return Collections.singleton(set.iterator().next());
      default:
        return Collections.unmodifiableSet(set);
    }
  }
1164479
@ReplacedBy("com.google.common.collect.Iterators#unmodifiableIterator()")
    public static <T> Iterator<T> getUnmodifiableIterator (final Iterator<T> itr)
    {
        return new Iterator<T>() {
            public boolean hasNext () {
                return itr.hasNext();
            }
            public T next () {
                return itr.next();
            }
            public void remove () {
                throw new UnsupportedOperationException(
                    "Cannot remove from an UnmodifiableIterator!");
            }
        };
    }
399695
@Override
    public SortedSet<Cell<V>> cells() {
        return new ForwardingSortedSet<Cell<V>>() {
            @Override
            protected SortedSet<Cell<V>> delegate() {
                return cells;
            }
            @Override
            public boolean add(Cell<V> element) {
                return super.add(ImmutableCell.copyOf(element));
            }
            @Override
            public boolean addAll(Collection<? extends Cell<V>> collection) {
                return super.standardAddAll(collection);
            }
        };
    }
1150530
public static <T> Set<T> unmodifiableSet(Set<? extends T> s) {
		return Collections.unmodifiableSet(s);
	}
994982
@Override
    public Set<K> keySet() {
        final Set<K> localSet = this.localMap.keySet();

        if (isReadyOnly())
            return Collections.unmodifiableSet(localSet);

        return localSet;
    }
744409
public static <K, V, M extends Map<K, V>> UnmodifiableMutableMap<K, V> of(M map)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("cannot create a UnmodifiableMutableMap for null");
        }
        return new UnmodifiableMutableMap<K, V>(MapAdapter.adapt(map));
    }
895684
public static <K, V, M extends SortedMap<K, V>> UnmodifiableTreeMap<K, V> of(M map)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("cannot create a UnmodifiableSortedMap for null");
        }
        return new UnmodifiableTreeMap<K, V>(SortedMapAdapter.adapt(map));
    }