public static <T, K, V> Collector<T, ?, ImmutableSortedMap<K, V>> toSortedMap(Comparator<? super K> comparator, Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper) {
        return Collector.of(
                () -> new ImmutableSortedMap.Builder<K, V>(comparator),
                (builder, input) -> builder.put(keyMapper.apply(input), valueMapper.apply(input)),
                (l, r) -> l.putAll(r.build()),
                ImmutableSortedMap.Builder::build,
                Collector.Characteristics.UNORDERED
        );
    }
Immutable implementations of {@link Collector} using Guava's immutable collections.
helper/src/main/java/me/lucko/helper/utils/ImmutableCollectors.java