find State
Get state by name. This might be used to start listening to state after state machine setup.
Find state by type. Search by type is suitable when using own state subclasses that usually do not have a name. Only on state should match the type or exception will be thrown.
For internal use. Workaround that Kotlin does not support recursive inline functions.