private void checkIdInRange(int id) {
    if (id < 0 || id >= max) {
      throw new IllegalArgumentException("Illegal id: " + id + ", legal range: [0, " + max + "[");
    }
  }
@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/ArrayDoubleMinHeap.java