public int getAndRemoveHighestCount() {
      int maxIndex = -1;
      int maxReg = -1;
      int maxCount = 0;

      for (int i = 0; i < size; i++) {
        if (maxCount < count[i]) {
          maxIndex = i;
          maxReg = reg[i];
          maxCount = count[i];
        }
      }

      count[maxIndex] = 0;
      return maxReg;
    }
Searches the set for the element that has been added the most. In the case of a tie, the
element that was added first is returned. Then, it clears the count on that element. The size
of the set remains unchanged.

@return element with the highest count
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java