safeSubSet

fun <T> Collection<T>.safeSubSet(from: Int, to: Int): Set<T>

Run List.subList on any Collection safely without throwing any exception if the provided start/end values do not exist.

Return

a Set which only holds elements of the original Collection within it's provided bounds.