ObservableList extends AbstractObservable implements List<E> { @NotNull @Override public Object[] toArray() { return myInnerList.toArray(); } ObservableList();  ObservableList(@NotNull Iterable<? extends E> otherCollection); void beginUpdate(); void endUpdate(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @NotNull @Override Iterator<E> iterator(); @NotNull @Override Object[] toArray(); @NotNull @Override T[] toArray(T[] a); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); boolean setAll(@NotNull Collection<? extends E> c); @Override boolean addAll(int index, Collection<? extends E> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Nullable @Override E get(int index); @Nullable @Override E set(int index, E element); @Override void add(int index, E element); @Nullable @Override E remove(int index); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); @NotNull @Override ListIterator<E> listIterator(); @NotNull @Override ListIterator<E> listIterator(int index); @NotNull @Override List<E> subList(int fromIndex, int toIndex); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }
@Test public void testToArray() throws Exception { ObservableList<String> list = new ObservableList<String>(); list.add("A"); list.add("B"); list.add("C"); assertThat(list.toArray()).isEqualTo(new String[]{"A", "B", "C"}); }