The tennis kata implemented as a state machine