<p>
Add items.
</p>

<p>
If {@link #items} is null an empty list of {@link M} will be created first.
</p>

@param newItems items
326787
public void addNewItems(List<M> newItems) {
    if (this.items == null) {
      this.items = createEmptyList();
    }

    this.items.addAll(newItems);
  }
1086532
private <ItemT> void addInternal(@Nonnull Iterable<ItemT> items) {
        // Note that items can be a large lazily evaluated collection,
        // so this method is optimized to only iterate through it as much as needed.

        if (!items.iterator().hasNext()) {
            return;
        }

        nextBuildNumber = getNextBuildNumber(items.iterator().next());

        if (newerThan == null && olderThan == null) {
            // Just return the first page of entries (newest)
            Iterator<ItemT> iter = items.iterator();
            while (iter.hasNext()) {
                add(iter.next());
                if (isFull()) {
                    break;
                }
            }
            hasDownPage = iter.hasNext();
        } else if (newerThan != null) {
            int toFillCount = getFillCount();
            if (toFillCount > 0) {
                // Walk through the items and keep track of the oldest
                // 'toFillCount' items until we reach an item older than
                // 'newerThan' or the end of the list.
                LinkedList<ItemT> itemsToAdd = new LinkedList<>();
                Iterator<ItemT> iter = items.iterator();
                while (iter.hasNext()) {
                    ItemT item = iter.next();
                    if (HistoryPageEntry.getEntryId(item) > newerThan) {
                        itemsToAdd.addLast(item);

                        // Discard an item off the front of the list if we have
                        // to (which means we would be able to page up).
                        if (itemsToAdd.size() > toFillCount) {
                            itemsToAdd.removeFirst();
                            hasUpPage = true;
                        }
                    } else {
                        break;
                    }
                }
                if (itemsToAdd.size() == 0) {
                    // All builds are older than newerThan ?
                    hasDownPage = true;
                } else {
                    // If there's less than a full page of items newer than
                    // 'newerThan', then it's ok to fill the page with older items.
                    if (itemsToAdd.size() < toFillCount) {
                        // We have to restart the iterator and skip the items that we added (because
                        // we may have popped an extra item off the iterator that did not get added).
                        Iterator<ItemT> skippedIter = items.iterator();
                        Iterators.skip(skippedIter, itemsToAdd.size());
                        for (int i = itemsToAdd.size(); i < toFillCount && skippedIter.hasNext(); i++) {
                            ItemT item = skippedIter.next();
                            itemsToAdd.addLast(item);
                        }
                    }
                    hasDownPage = iter.hasNext();
                    for (Object item : itemsToAdd) {
                        add(item);
                    }
                }
            }
        } else if (olderThan != null) {
            Iterator<ItemT> iter = items.iterator();
            while (iter.hasNext()) {
                Object item = iter.next();
                if (HistoryPageEntry.getEntryId(item) >= olderThan) {
                    hasUpPage = true;
                } else {
                    add(item);
                    if (isFull()) {
                        hasDownPage = iter.hasNext();
                        break;
                    }
                }
            }
        }
    }
508084
public final void add(@NonNull final AbstractItem item) {
        Condition.INSTANCE.ensureNotNull(item, "The item may not be null");
        items.add(item);

        if (item instanceof Item && ((Item) item).getIcon() != null) {
            iconCount++;
        } else if (item instanceof Divider) {
            dividerCount++;
        }

        rawItems = null;
        notifyOnDataSetChanged();
    }
229965
private void addItems(Map<String, String> values) {
        for (String itemName : values.keySet()) {
            setItem(itemName, values.get(itemName));
        }
    }
29834
public void setItems(java.util.Collection<DocumentationPart> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<DocumentationPart>(items);
    }
678217
public DrawerView addItems(List<DrawerItem> items) {
        mAdapter.setNotifyOnChange(false);
        for (DrawerItem item : items) {
            if (item.getId() <= 0) {
                item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
            }
            for (DrawerItem oldItem : mAdapter.getItems()) {
                if (oldItem.getId() == item.getId()) {
                    mAdapter.remove(oldItem);
                    break;
                }
            }

            item.attachTo(mAdapter);
            mAdapter.add(item);
        }
        mAdapter.setNotifyOnChange(true);
        mAdapter.notifyDataSetChanged();
        updateList();
        return this;
    }
1127801
def add(self, item):
        """"""
        if not item in self.items:
            self.items.append(item)
162373
public void setItems(java.util.Collection<Stage> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<Stage>(items);
    }
1280821
public SetBuilder<T> add(T... items) {
        set.addAll(Arrays.asList(items));
        return this;
    }
696621
private void setItems(@NonNull List<IDrawerItem> drawerItems, boolean switchedItems) {
        //if we are currently at a switched list set the new reference
        if (originalDrawerItems != null && !switchedItems) {
            originalDrawerItems = drawerItems;
        }
        mDrawerBuilder.getItemAdapter().setNewList(drawerItems);
    }
1362824
public ListSelectDialogBuilder<T> addListItems(T... items) {
        this.content.addAll(Arrays.asList(items));
        return this;
    }
930648
public void setItems(java.util.Collection<SdkType> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<SdkType>(items);
    }
1186895
public void setItems(java.util.Collection<Api> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<Api>(items);
    }
815748
public void setItemIds(@Nullable ItemIds<? super T> itemIds) {
        if (this.itemIds != itemIds) {
            this.itemIds = itemIds;
            setHasStableIds(itemIds != null);
        }
    }
950130
public void setItems(java.util.Collection<RequestValidator> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<RequestValidator>(items);
    }
634902
public void addExistingItem(final ItemsNodeInterval newNode) {
        Preconditions.checkState(newNode.getItems().size() == 1, "Invalid node=%s", newNode);
        final Item item = newNode.getItems().get(0);

        addNode(newNode,
                new AddNodeCallback() {
                    @Override
                    public boolean onExistingNode(final NodeInterval existingNode) {
                        final ItemsInterval existingOrNewNodeItems = ((ItemsNodeInterval) existingNode).getItemsInterval();
                        existingOrNewNodeItems.add(item);
                        // There is no new node added but instead we just populated the list of items for the already existing node
                        return false;
                    }

                    @Override
                    public boolean shouldInsertNode(final NodeInterval insertionNode) {
                        // Always want to insert node in the tree when we find the right place.
                        return true;
                    }
                });
    }
368340
public void addItems(Collection<Item> itemsToAdd) {
        if (itemsToAdd == null) return;
        for (Item i : itemsToAdd) {
            addItem(i);
        }
    }