code: public static <E> NavigableSet<E> unmodifiableNavigableSet(NavigableSet<E> set) {
      if (set instanceof ImmutableCollection || set instanceof UnmodifiableNavigableSet) {
        return set;
      }
      return new UnmodifiableNavigableSet<E>(set);
    }
docs: Returns an unmodifiable view of the specified navigable set. This method allows modules to
  provide users with "read-only" access to internal navigable sets. Query operations on the
  returned set "read through" to the specified set, and attempts to modify the returned set,
  whether direct or via its collection views, result in an {@code UnsupportedOperationException}.
  
  <p>The returned navigable set will be serializable if the specified navigable set is
  serializable.
  
  @param set the navigable set for which an unmodifiable view is to be returned
  @return an unmodifiable view of the specified navigable set
  @since 12.0