docs: private void cleanup() {
          StatsDataReference ref = null;
          while ((ref = (StatsDataReference) statisticsReferenceQueue.poll()) != null) {
              StatsData oldStats = null;
              StatsData updatedStats = null;
              do {
                  oldStats = terminatedThreadStats.get();
                  updatedStats = aggregateStats(oldStats, ref.statsData);
              } while (!terminatedThreadStats.compareAndSet(oldStats, updatedStats));
              allReferences.remove(ref);
          }
      }