--- jsr166/src/test/tck/AtomicReferenceArrayTest.java 2011/05/31 16:16:23 1.21 +++ jsr166/src/test/tck/AtomicReferenceArrayTest.java 2011/06/10 19:26:10 1.22 @@ -51,6 +51,21 @@ public class AtomicReferenceArrayTest ex } /** + * Initialize AtomicReference with SubClass[] + */ + public void testConstructorSubClassArray() { + Integer[] a = { two, one, three, four, seven }; + AtomicReferenceArray aa = new AtomicReferenceArray(a); + assertEquals(a.length, aa.length()); + for (int i = 0; i < a.length; ++i) { + assertSame(a[i], aa.get(i)); + Long x = Long.valueOf(i); + aa.set(i, x); + assertSame(x, aa.get(i)); + } + } + + /** * get and set for out of bound indices throw IndexOutOfBoundsException */ public void testIndexing() {