use of java.util.concurrent.LinkedTransferQueue in project j2objc by google.
the class LinkedTransferQueueTest method testConstructor5.
/**
* Queue contains all elements of the collection it is initialized by
*/
public void testConstructor5() {
Integer[] ints = new Integer[SIZE];
for (int i = 0; i < SIZE; ++i) {
ints[i] = i;
}
List intList = Arrays.asList(ints);
LinkedTransferQueue q = new LinkedTransferQueue(intList);
assertEquals(q.size(), intList.size());
assertEquals(q.toString(), intList.toString());
assertTrue(Arrays.equals(q.toArray(), intList.toArray()));
assertTrue(Arrays.equals(q.toArray(new Object[0]), intList.toArray(new Object[0])));
assertTrue(Arrays.equals(q.toArray(new Object[SIZE]), intList.toArray(new Object[SIZE])));
for (int i = 0; i < SIZE; ++i) {
assertEquals(ints[i], q.poll());
}
}
Aggregations