rotateNext

fun <T> List<T>.rotateNext(element: T): T?

Implements a forward cycling through a List instance.

Return

the next element or the first, if called on last. null if element is not present in the list.

Parameters

element

some element of the list, for that the next one should be found.