Related PR : #5691
The result of `TopKSelector` may be wrong when `trim()` is invoked and quiksort fallback to `Arrasys.sort()`. Because `Arrasys.sort()` is been used by mistake there.
Following test case can trigger this bug.
```
{
    int n = 10000;
    int k = 10000;
    int testIteration = 10;
    Random random = new Random(System.currentTimeMillis());
    for (int iter = 0; iter < testIteration; iter ++) {
      // target array to be sorted using TopKSelector
      List<Integer> target = new ArrayList<>();
      for (int i = 0; i < 9; i++) {
        List<Integer> sortedArray = new ArrayList();
        for (int j = 0; j < n; j++) {
          sortedArray.add(random.nextInt());
        }
        sortedArray.sort(Integer::compareTo);
        target.addAll(sortedArray);
      }

      TopKSelector<Integer> top = TopKSelector.least(k, Integer::compareTo);
      for (int value : target) {
        top.offer(value);
      }

      target.sort(Integer::compareTo);
      assertEquals(top.topK(), target.subList(0, k));
    }
  }
```
if (iterations >= maxIterations) {
        // 
        Arrays.sort(buffer, left, right, comparator);
        break;
      }
    }
    bufferSize = k;
    threshold = uncheckedCastNullableTToT(buffer[minThresholdPosition]);
    for (int i = minThresholdPosition + 1; i < k; i++) {
      if (comparator.compare(
              uncheckedCastNullableTToT(buffer[i]), uncheckedCastNullableTToT(threshold))
          > 0) {
        threshold = buffer[i];
      }
    }
  }
  /**
   * Partitions the contents of buffer in the range [left, right] around the pivot element
   * previously stored in buffer[pivotValue]. Returns the new index of the pivot element,
   * pivotNewIndex, so that everything in [left, pivotNewIndex] is ≤ pivotValue and everything in
   * (pivotNewIndex, right] is greater than pivotValue.
   */
  private int partition(int left, int right, int pivotIndex) {
    T pivotValue = uncheckedCastNullableTToT(buffer[pivotIndex]);
    buffer[pivotIndex] = buffer[right];
    int pivotNewIndex = left;
    for (int i = left; i < right; i++) {
      if (comparator.compare(uncheckedCastNullableTToT(buffer[i]), pivotValue) < 0) {
        swap(pivotNewIndex, i);
        pivotNewIndex++;