protected int @NotNull [] remove(int @NotNull [] array, int startIndex, int endIndex) {
    if (endIndex < mySegmentCount) {
      System.arraycopy(array, endIndex, array, startIndex, mySegmentCount - endIndex);
    }
    return array;
  }
protected int @NotNull [] remove(int @NotNull [] array, int startIndex, int endIndex)