public Listener<CopycatServer.State> onStateChange(Consumer<CopycatServer.State> listener){
  return stateChangeListeners.add(listener);
}

public Listener < CopycatServer . State > onStateChange ( Consumer < CopycatServer . State > listener ) { return stateChangeListeners . add ( listener ) ; }
registers a state change listener .
