/** * A sensible default implementation of {@link #addAll(int, Collection)}, in terms of the {@code * add} method of {@link #listIterator(int)}. If you override {@link #listIterator(int)}, you may * wish to override {@link #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll(int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in terms of the {@code * add} method of {@link #listIterator(int)}. If you override {@link #listIterator(int)}, you may * wish to override {@link #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll(int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in terms of the {@code * add} method of {@link #listIterator(int)}. If you override {@link #listIterator(int)}, you may * wish to override {@link #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll(int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
Iterable<String> iterableToAdd = toAdd.get(i); boolean expectedChanged = iterableToAdd.iterator().hasNext(); assertThat(Lists.addAllImpl(toTest, index, iterableToAdd)) .named(format, iterableToAdd, index) .isEqualTo(expectedChanged);
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in terms of the {@code * add} method of {@link #listIterator(int)}. If you override {@link #listIterator(int)}, you may * wish to override {@link #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll(int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll(int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in terms of the {@code * add} method of {@link #listIterator(int)}. If you override {@link #listIterator(int)}, you may * wish to override {@link #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ protected boolean standardAddAll(int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7.0 */ @Beta protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
/** * A sensible default implementation of {@link #addAll(int, Collection)}, in * terms of the {@code add} method of {@link #listIterator(int)}. If you * override {@link #listIterator(int)}, you may wish to override {@link * #addAll(int, Collection)} to forward to this implementation. * * @since 7 */ @Beta protected boolean standardAddAll( int index, Iterable<? extends E> elements) { return Lists.addAllImpl(this, index, elements); }
public void testAddAllImpl() { if (getExample().modifiability() != Modifiability.ALL) { return; } List<String> toTest = createList(String.class); List<Iterable<String>> toAdd = ImmutableList.of( Collections.singleton("A"), Collections.emptyList(), ImmutableList.of("A", "B", "C"), ImmutableList.of("D", "E")); List<Integer> indexes = ImmutableList.of(0, 0, 1, 3); List<List<String>> expected = ImmutableList.of( ImmutableList.of("A"), ImmutableList.of("A"), ImmutableList.of("A", "A", "B", "C"), ImmutableList.of("A", "A", "D", "E", "B", "C")); String format = "Adding %s at %s"; for (int i = 0; i < toAdd.size(); i++) { int index = indexes.get(i); Iterable<String> iterableToAdd = toAdd.get(i); boolean expectedChanged = iterableToAdd.iterator().hasNext(); assertThat(Lists.addAllImpl(toTest, index, iterableToAdd)).named(format, iterableToAdd, index) .isEqualTo(expectedChanged); assertThat(toTest).named(format, iterableToAdd, index) .containsExactlyElementsIn(expected.get(i)); } }