public void addListener(@NotNull StateChangeListener listener){
  listeners.add(listener);
}

public void addListener ( @ NotNull StateChangeListener listener ) { listeners . add ( listener ) ; }
adds a listener for detecting state changing .
