[cvs] / jsr166 / src / test / tck / LinkedListTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/LinkedListTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.47, Tue Apr 3 05:49:43 2018 UTC revision 1.48, Mon May 28 21:19:50 2018 UTC
# Line 358  Line 358 
358       */       */
359      public void testToArray() {      public void testToArray() {
360          LinkedList q = populatedQueue(SIZE);          LinkedList q = populatedQueue(SIZE);
361          Object[] o = q.toArray();          Object[] a = q.toArray();
362          for (int i = 0; i < o.length; i++)          assertSame(Object[].class, a.getClass());
363              assertSame(o[i], q.poll());          for (Object o : a)
364                assertSame(o, q.poll());
365            assertTrue(q.isEmpty());
366      }      }
367    
368      /**      /**
# Line 371  Line 373 
373          Integer[] ints = new Integer[SIZE];          Integer[] ints = new Integer[SIZE];
374          Integer[] array = q.toArray(ints);          Integer[] array = q.toArray(ints);
375          assertSame(ints, array);          assertSame(ints, array);
376          for (int i = 0; i < ints.length; i++)          for (Integer o : ints)
377              assertSame(ints[i], q.poll());              assertSame(o, q.poll());
378            assertTrue(q.isEmpty());
379      }      }
380    
381      /**      /**

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8