private int comparePosPos(long val1, long val2, int pos1, int pos2) {
    if (val1 < val2) {
      return -1;
    } else if (val1 == val2 && val1 != Long.MIN_VALUE) {
      return tieBreaker.applyAsInt(posToId[pos1], posToId[pos2]);
    }
    return 1;
  }
@param elements the number of elements that can be stored in this heap. Currently the heap cannot be resized or
                shrunk/trimmed after initial creation. elements-1 is the maximum id that can be stored in this heap
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/ArrayLongMinHeap.java