// Path: collection/src/main/java/com/github/andrewoma/dexx/collection/SortedSet.java
// public interface SortedSet<E> extends Set<E> {
//     /**
//      * Returns the first element in the set or {@code null} of the set is empty.
//      */
//     @Nullable
//     E first();
// 
//     /**
//      * Returns the last element in the set or {@code null} of the set is empty.
//      */
//     @Nullable
//     E last();
// 
//     /**
//      * Returns a set containing all elements in this set, excluding the first {@code number} of elements.
//      */
//     @NotNull
//     SortedSet<E> drop(int number);
// 
//     /**
//      * Returns a set containing the first {@code number} of elements from this set.
//      */
//     @NotNull
//     SortedSet<E> take(int number);
// 
//     @Override
//     @NotNull
//     SortedSet<E> add(E value);
// 
//     @Override
//     @NotNull
//     SortedSet<E> remove(E value);
// 
//     /**
//      * Returns the comparator associated with this map, or {@code null} if the default ordering is used.
//      */
//     Comparator<? super E> comparator();
// 
//     /**
//      * Returns the bottom of the set starting from the key specified.
//      *
//      * @param inclusive if true, the key will be included in the result, otherwise it will be excluded
//      */
//     @NotNull
//     SortedSet<E> from(@NotNull E value, boolean inclusive);
// 
//     /**
//      * Returns the top of the set up until the key specified.
//      *
//      * @param inclusive if true, the key will be included in the result, otherwise it will be excluded
//      */
//     @NotNull
//     SortedSet<E> to(@NotNull E value, boolean inclusive);
// 
//     /**
//      * Returns a subset of the set between the {@code from} and {@code to} keys specified.
//      *
//      * @param fromInclusive if true, the key will be included in the result, otherwise it will be excluded
//      * @param toInclusive   if true, the key will be included in the result, otherwise it will be excluded
//      */
//     @NotNull
//     SortedSet<E> range(@NotNull E from, boolean fromInclusive, @NotNull E to, boolean toInclusive);
// 
//     /**
//      * Returns an immutable view of this set as an instance of {@code java.util.SortedSet}.
//      */
//     @NotNull
//     java.util.SortedSet<E> asSortedSet();
// }


import com.github.andrewoma.dexx.collection.SortedSet;
import org.jetbrains.annotations.NotNull;
import java.util.Comparator;
import java.util.NoSuchElementException;
    @NotNull
    @Override
    public Comparator<? super E> comparator() {
        return set.comparator();
    }

    @NotNull
    @Override
    public java.util.SortedSet<E> subSet(E fromElement, E toElement) {
        return new SortedSetAdapter<E>(set.range(fromElement, true, toElement, false));
    }

    @NotNull
    @Override
    public java.util.SortedSet<E> headSet(E toElement) {
        return new SortedSetAdapter<E>(set.to(toElement, false));
    }

    @NotNull
    @Override
    public java.util.SortedSet<E> tailSet(E fromElement) {
        return new SortedSetAdapter<E>(set.from(fromElement, true));
    }

    @Override
    public E first() {
        if (set.isEmpty()) throw new NoSuchElementException("Empty set");
        return set.first();
    }

// Path: collection/src/main/java/com/github/andrewoma/dexx/collection/SortedSet.java
// public interface SortedSet<E> extends Set<E> {
//     /**
//      * Returns the first element in the set or {@code null} of the set is empty.
//      */
//     @Nullable
//     E first();
// 
//     /**
//      * Returns the last element in the set or {@code null} of the set is empty.
//      */
//     @Nullable
//     E last();
// 
//     /**
//      * Returns a set containing all elements in this set, excluding the first {@code number} of elements.
//      */
//     @NotNull
//     SortedSet<E> drop(int number);
// 
//     /**
//      * Returns a set containing the first {@code number} of elements from this set.
//      */
//     @NotNull
//     SortedSet<E> take(int number);
// 
//     @Override
//     @NotNull
//     SortedSet<E> add(E value);
// 
//     @Override
//     @NotNull
//     SortedSet<E> remove(E value);
// 
//     /**
//      * Returns the comparator associated with this map, or {@code null} if the default ordering is used.
//      */
//     Comparator<? super E> comparator();
// 
//     /**
//      * Returns the bottom of the set starting from the key specified.
//      *
//      * @param inclusive if true, the key will be included in the result, otherwise it will be excluded
//      */
//     @NotNull
//     SortedSet<E> from(@NotNull E value, boolean inclusive);
// 
//     /**
//      * Returns the top of the set up until the key specified.
//      *
//      * @param inclusive if true, the key will be included in the result, otherwise it will be excluded
//      */
//     @NotNull
//     SortedSet<E> to(@NotNull E value, boolean inclusive);
// 
//     /**
//      * Returns a subset of the set between the {@code from} and {@code to} keys specified.
//      *
//      * @param fromInclusive if true, the key will be included in the result, otherwise it will be excluded
//      * @param toInclusive   if true, the key will be included in the result, otherwise it will be excluded
//      */
//     @NotNull
//     SortedSet<E> range(@NotNull E from, boolean fromInclusive, @NotNull E to, boolean toInclusive);
// 
//     /**
//      * Returns an immutable view of this set as an instance of {@code java.util.SortedSet}.
//      */
//     @NotNull
//     java.util.SortedSet<E> asSortedSet();
// }


// Path: collection/src/main/java/com/github/andrewoma/dexx/collection/internal/adapter/SortedSetAdapter.java
import com.github.andrewoma.dexx.collection.SortedSet;
import org.jetbrains.annotations.NotNull;
import java.util.Comparator;
import java.util.NoSuchElementException;

    @NotNull
    @Override
    public Comparator<? super E> comparator() {
        return set.comparator();
    }

    @NotNull
    @Override
    public java.util.SortedSet<E> subSet(E fromElement, E toElement) {
        return new SortedSetAdapter<E>(set.range(fromElement, true, toElement, false));
    }

    @NotNull
    @Override
    public java.util.SortedSet<E> headSet(E toElement) {
        return new SortedSetAdapter<E>(set.to(toElement, false));
    }

    @NotNull
    @Override
    public java.util.SortedSet<E> tailSet(E fromElement) {
        return new SortedSetAdapter<E>(set.from(fromElement, true));
    }

    @Override
    public E first() {
        if (set.isEmpty()) throw new NoSuchElementException("Empty set");
        return set.first();
    }

    @Override