docs: private int sample(Queue<OutboundFrame> q) {
          packets.addAll(q);
  
          if (packets.size() < threshold) {
              return -1;
          }
  
          int sampleCount = min(samples, packets.size());
          int actualSampleCount = 0;
          for (int k = 0; k < sampleCount; k++) {
              OutboundFrame packet = packets.get(random.nextInt(packets.size()));
              String key = toKey(packet);
  
              if (key != null) {
                  actualSampleCount++;
                  occurrenceMap.add(key, 1);
              }
          }
  
          return actualSampleCount;
      }