static void remove(Object[] input, int i) {
    int j = i + 2;
    for (; j < input.length; i += 2, j += 2) {
      if (input[j] == null) break; // found null key
      input[i] = input[j];
      input[i + 1] = input[j + 1];
    }
    input[i] = input[i + 1] = null;
  }
@Test void remove() {
    // internally, remove is never called on odd number, or at or after array length
    {
      Object[] array = new Object[] {1, 2, 3, 4, 5, 6};
      MutableSpan.remove(array, 0);
      assertThat(array).containsExactly(3, 4, 5, 6, null, null);
    }
    {
      Object[] array = new Object[] {1, 2, 3, 4, 5, 6};
      MutableSpan.remove(array, 2);
      assertThat(array).containsExactly(1, 2, 5, 6, null, null);
    }
    {
      Object[] array = new Object[] {1, 2, 3, 4, 5, 6};
      MutableSpan.remove(array, 4);
      assertThat(array).containsExactly(1, 2, 3, 4, null, null);
    }
  }