private static void checkOutOfBoundsForAdd(int index, int size) {
    if (index < 0 || index > size) {
      throw new IndexOutOfBoundsException(outOfBoundsMessage(index, size));
    }
  }
private static void checkOutOfBoundsForAdd(int index, int size)