Java Code Examples for java.util.concurrent.CopyOnWriteArrayList#toArray()
The following examples show how to use
java.util.concurrent.CopyOnWriteArrayList#toArray() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CopyOnWriteArrayListTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * toArray throws an ArrayStoreException when the given array * can not store the objects inside the list */ public void testToArray_ArrayStoreException() { CopyOnWriteArrayList c = new CopyOnWriteArrayList(); c.add("zfasdfsdf"); c.add("asdadasd"); try { c.toArray(new Long[5]); shouldThrow(); } catch (ArrayStoreException success) {} }
Example 2
Source File: CopyOnWriteArrayListTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * toArray throws an ArrayStoreException when the given array * can not store the objects inside the list */ public void testToArray_ArrayStoreException() { CopyOnWriteArrayList c = new CopyOnWriteArrayList(); c.add("zfasdfsdf"); c.add("asdadasd"); try { c.toArray(new Long[5]); shouldThrow(); } catch (ArrayStoreException success) {} }