51 |
|
} |
52 |
|
|
53 |
|
/** |
54 |
+ |
* Initialize AtomicReference<Class> with SubClass[] |
55 |
+ |
*/ |
56 |
+ |
public void testConstructorSubClassArray() { |
57 |
+ |
Integer[] a = { two, one, three, four, seven }; |
58 |
+ |
AtomicReferenceArray<Number> aa = new AtomicReferenceArray<Number>(a); |
59 |
+ |
assertEquals(a.length, aa.length()); |
60 |
+ |
for (int i = 0; i < a.length; ++i) { |
61 |
+ |
assertSame(a[i], aa.get(i)); |
62 |
+ |
Long x = Long.valueOf(i); |
63 |
+ |
aa.set(i, x); |
64 |
+ |
assertSame(x, aa.get(i)); |
65 |
+ |
} |
66 |
+ |
} |
67 |
+ |
|
68 |
+ |
/** |
69 |
|
* get and set for out of bound indices throw IndexOutOfBoundsException |
70 |
|
*/ |
71 |
|
public void testIndexing() { |