public ScreenView transitionToNextScreen(boolean changeMode) {
    Mode selectedMode = modes.get(currentPosition);
    if (changeMode && currentMode != selectedMode) {
      resultListener.accept(selectedMode);
    }
    return nextScreenView;
  }
The presentation logic for the mode screen.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/screen/mode/ModeScreenPresenter.java