@Override
  public boolean hasHistory(boolean backward) {
    return !myHistory.isEmpty() && (backward ? myHistoryIndex > 0 : myHistoryIndex < myHistory.size() - 1);
  }
@Override
  public boolean hasHistory(boolean backward)