public static void checkIndex(int index, int size, @NotNull String indexDescription) {
    if (index < 0 || index >= size) {
      throw new IndexOutOfBoundsException(badElementIndex(index, size, indexDescription));
    }
  }
public static void checkIndex(int index, int size, @NotNull String indexDescription)