code: public void setMaxHistory(int maxHistory)
      {
          this.maxHistory = maxHistory;
          if(history != null)
              if (this.maxHistory == 0)
                  history.clear();
              else
                  while (history.size() > maxHistory)
                      history.removeFirst();
      }
docs: Sets the maximum number of items to store in history. Setting this to
  {@code 0} will keep the detector from ever storing history. <br>
  The user can still keep their own independent history or checkpoints by
  using the {@link #isDrifting() } and {@link #isWarning() } methods. <br>
  <br>
  The history size may be changed at any time, but may result in the loss
  of history.
  
  @param maxHistory the new maximum history size of objects added