A general purpose easy to use thread-safe Finite State Machine in Java