(Queue<Object> q)
| 135 | } |
| 136 | |
| 137 | public static void toArrayTest(Queue<Object> q) { |
| 138 | if (q.toArray().length != 0) { |
| 139 | throw new RuntimeException(); |
| 140 | } |
| 141 | |
| 142 | Object testObject = new Object(); |
| 143 | q.add(testObject); |
| 144 | |
| 145 | Object[] result = q.toArray(); |
| 146 | verify(result.length == 1); |
| 147 | verify(result[0] == testObject); |
| 148 | } |
| 149 | } |