rotatePrevious

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

Implements a backwards cycling through a List instance.

Return

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

Parameters

element

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