private <T> void removeRange(T @NotNull [] array, int startIndex, int endIndex) {
      if (endIndex < mySegmentCount) {
        System.arraycopy(array, endIndex, array, startIndex, mySegmentCount - endIndex);
      }
      Arrays.fill(array, mySegmentCount - (endIndex - startIndex), mySegmentCount, null);
    }
private <T> void removeRange(T @NotNull [] array, int startIndex, int endIndex)