I want to write a function that returns every item in a List that is not the first or the last item (a via point). The function gets a generic List<*&g
List
List<*&g
I made a little variation to @hotkey answer when used to check Serializable to List objects :
@Suppress("UNCHECKED_CAST") inline fun Serializable.checkSerializableIsListOf() = if (this is List<*> && this.all { it is T }) this as List else null