class _Sets {

    public static <T> 
    Collector<T, ?, SortedSet<T>> toUnmodifiableSorted(Supplier<SortedSet<T>> collectionFactory) {
        return Collectors.collectingAndThen(
                Collectors.toCollection(collectionFactory), 
                Collections::unmodifiableSortedSet);
    }

}