safeSubList

fun <T> Collection<T>.safeSubList(from: Int, to: Int): List<T>

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

Return

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