code: private void removeExceedingResults(int maximumResultCount) {
          int resultCount = results.size();
          if (resultCount > maximumResultCount) {
              // Removing old results
              final int nbResultsToRemove = resultCount - maximumResultCount;
              for (int i = 0; i < nbResultsToRemove; i++) {
                  results.remove(0);
              }
          }
      }
docs: Removes the N first results which exceed the maximum tick count.
  (i.e. keeps only the last maximumResultCount results)
  @param maximumResultCount the number of results to keep