@Override
  public void push(int id, double value) {
    checkIdInRange(id);
    if (size == max) {
      throw new IllegalStateException("Cannot push anymore, the heap is already full. size: " + size);
    }
    if (contains(id)) {
      throw new IllegalStateException("Element with id: " + id +
        " was pushed already, you need to use the update method if you want to change its value");
    }
    size++;
    posToId[size] = id;
    idToPos[id] = size;
    posToValue[size] = value;
    percolateUp(size);
  }
@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