fun <T> Map<T, T>.mapParents(child: T, failIfCyclic: Boolean = false): LinkedHashSet<T> (source)
It is assumed that the Map represents a child parent relation where this function returns a LinkedHashSet with all collected parents.
A key represent a child and the value its parent.
child - Defines the starting point of the search.
failIfCyclic - false per default but can be set to true in which case it throws an IllegalStateException
if a cycle is detected.
IllegalStateException - In case failIfCyclic is true and a cycle is detected.
Return
The collected parents in order.