docs: public void setMaxHistory(int maxHistory)
      {
          this.maxHistory = maxHistory;
          if(history != null)
              if (this.maxHistory == 0)
                  history.clear();
              else
                  while (history.size() > maxHistory)
                      history.removeFirst();
      }