/guava/guava/src/com/google/common/collect/TopKSelector.java
buffer[bufferSize++] = elem; } else if ( bufferSize < k) {bufferSize = 1;
bufferSize = 1; } else if ( bufferSize < k ) { buffer[bufferSize++] = elem;
public void offer(@ParametricNullness T elem) { if (k == 0) { return; } else if (bufferSize == 0) { buffer[0] = elem; threshold = elem; <extra_id_0> if (comparator.compare(elem, uncheckedCastNullableTToT(threshold)) > 0) { threshold = elem; } } else if (comparator.compare(elem, uncheckedCastNullableTToT(threshold)) < 0) { buffer[bufferSize++] = elem; if (bufferSize == 2 * k) {