public void prune() {
    while(size() > (maxBufferSize <= 0 ? MAX_BUFFER_SIZE_HARDLIMIT : maxBufferSize)) {
      int maxStepCount = Integer.MIN_VALUE;
      for(Integer e : stateMap.keySet())
        if(e > maxStepCount)
          maxStepCount = e;
      stateMap.get(maxStepCount).removeAny(false /*stateMap.size() <= 1*/);
      if(stateMap.get(maxStepCount).size() == 0)
        stateMap.remove(maxStepCount);
    }
  }