@Test public void simple() { ValueOptionList<IntOption> list = new Mock(3); assertThat(list, equalTo(Arrays.asList(new IntOption(), new IntOption(), new IntOption()))); IntOption e0 = list.get(0); IntOption e1 = list.get(1); IntOption e2 = list.get(2); list.set(0, new IntOption(0)); list.set(1, new IntOption(1)); list.set(2, new IntOption(2)); assertThat(list, equalTo(Arrays.asList(new IntOption(0), new IntOption(1), new IntOption(2)))); assertThat(e0, equalTo(new IntOption(0))); assertThat(e1, equalTo(new IntOption(1))); assertThat(e2, equalTo(new IntOption(2))); }
@SuppressWarnings("deprecation") @Override public E set(int index, E element) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } E result = get(index); result.copyFrom(element); return result; }
ValueOptionList extends AbstractList<E> implements RandomAccess { @SuppressWarnings("deprecation") @Override public E set(int index, E element) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } E result = get(index); result.copyFrom(element); return result; } }
ValueOptionList extends AbstractList<E> implements RandomAccess { @SuppressWarnings("deprecation") @Override public E set(int index, E element) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } E result = get(index); result.copyFrom(element); return result; }  }
ValueOptionList extends AbstractList<E> implements RandomAccess { @SuppressWarnings("deprecation") @Override public E set(int index, E element) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } E result = get(index); result.copyFrom(element); return result; }  @SuppressWarnings("deprecation") @Override E set(int index, E element); @Override void sort(Comparator<? super E> c); }
ValueOptionList extends AbstractList<E> implements RandomAccess { @SuppressWarnings("deprecation") @Override public E set(int index, E element) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } E result = get(index); result.copyFrom(element); return result; }  @SuppressWarnings("deprecation") @Override E set(int index, E element); @Override void sort(Comparator<? super E> c);  }