def move_first_element_of_successor_to_child(child_index)
      child = @children[child_index]
      succ = @children[child_index + 1]

      if child.is_leaf?
        # Adjust offset for the successor node
        @offsets[child_index + 1] += 1
        # Move the value
        child.values << succ.values.shift
      else
        # Before:
        #
        # Root Node             +--------------------------------+
        # Offsets               | 0                            7 |
        # Children                |                            |
        #              child      v    succ                    v
        # Level 1    +---------------++-------------------------------------+
        # Offsets    | 0         4   ||    0         4          6         9 |
        # Children     |         |         |         |          |         |
        #              v         v         v         v          v         v
        # Leaves  +---------++-------++----------++-------++----------++-------+
        # Values  | A B C D || E F G || H I J K  || L  M  || N  O  P  || Q  R  |
        #
        # Index     0 1 2 3    4 5 6    7 8 9 10    11 12    13 14 15    16 17
        #
        # After:
        #
        # Root Node             +--------------------------------+
        # Offsets               | 0                           11 |
        # Children                |                            |
        #              child      v                succ        v
        # Level 1    +--------------------------++--------------------------+
        # Offsets    | 0         4         7    ||   0          2         5 |
        # Children     |         |         |         |          |         |
        #              v         v         v         v          v         v
        # Leaves  +---------++-------++----------++-------++----------++-------+
        # Values  | A B C D || E F G || H I J K  || L  M  || N  O  P  || Q  R  |
        #
        # Index     0 1 2 3    4 5 6    7 8 9 10    11 12    13 14 15    16 17
        #
        # Adjust the offsets of the successor. The 2nd original offset
        # determines the delta for the parent node.
        succ.offsets.shift
        delta = succ.offsets.first
        succ.offsets.map! { |o| o -= delta }
        # The additional child offset can be taken from the parent node
        # reference.
        child.offsets << @offsets[child_index + 1]
        # The parent node offset of the successor needs to be corrected by the
        # delta value.
        @offsets[child_index + 1] += delta
        # Move the child reference
        child.children << succ.children.shift
        child.children.last.parent = child
      end
    end
def move_first_element_of_successor_to_child(child_index)
      child = @children[child_index]
      succ = @children[child_index + 1]

      if child.is_leaf?
        # Adjust offset for the successor node
        @offsets[child_index + 1] += 1
        # Move the value
        child.values << succ.values.shift
      else
        # Before:
        #
        # Root Node             +--------------------------------+
        # Offsets               | 0                            7 |
        # Children                |                            |
        #              child      v    succ                    v
        # Level 1    +---------------++-------------------------------------+
        # Offsets    | 0         4   ||    0         4          6         9 |
        # Children     |         |         |         |          |         |
        #              v         v         v         v          v         v
        # Leaves  +---------++-------++----------++-------++----------++-------+
        # Values  | A B C D || E F G || H I J K  || L  M  || N  O  P  || Q  R  |
        #
        # Index     0 1 2 3    4 5 6    7 8 9 10    11 12    13 14 15    16 17
        #
        # After:
        #
        # Root Node             +--------------------------------+
        # Offsets               | 0                           11 |
        # Children                |                            |
        #              child      v                succ        v
        # Level 1    +--------------------------++--------------------------+
        # Offsets    | 0         4         7    ||   0          2         5 |
        # Children     |         |         |         |          |         |
        #              v         v         v         v          v         v
        # Leaves  +---------++-------++----------++-------++----------++-------+
        # Values  | A B C D || E F G || H I J K  || L  M  || N  O  P  || Q  R  |
        #
        # Index     0 1 2 3    4 5 6    7 8 9 10    11 12    13 14 15    16 17
        #
        # Adjust the offsets of the successor. The 2nd original offset
        # determines the delta for the parent node.
        succ.offsets.shift
        delta = succ.offsets.first
        succ.offsets.map! { |o| o -= delta }
        # The additional child offset can be taken from the parent node
        # reference.
        child.offsets << @offsets[child_index + 1]
        # The parent node offset of the successor needs to be corrected by the
        # delta value.
        @offsets[child_index + 1] += delta
        # Move the child reference
        child.children << succ.children.shift
        child.children.last.parent = child
      end
    end
Move first element of successor to end of child node
 @param child_index [Integer] index of the child