public void testDrainTo(){
  LinkedBlockingQueue q=populatedQueue(SIZE);
  ArrayList l=new ArrayList();
  q.drainTo(l);
  assertEquals(q.size(),0);
  assertEquals(l.size(),SIZE);
  for (int i=0; i < SIZE; ++i)   assertEquals(l.get(i),new Integer(i));
  q.add(zero);
  q.add(one);
  assertFalse(q.isEmpty());
  assertTrue(q.contains(zero));
  assertTrue(q.contains(one));
  l.clear();
  q.drainTo(l);
  assertEquals(q.size(),0);
  assertEquals(l.size(),2);
  for (int i=0; i < 2; ++i)   assertEquals(l.get(i),new Integer(i));
}

public void testDrainTo ( ) { LinkedBlockingQueue q = populatedQueue ( SIZE ) ; ArrayList l = new ArrayList ( ) ; q . drainTo ( l ) ; assertEquals ( q . size ( ) , 0 ) ; assertEquals ( l . size ( ) , SIZE ) ; for ( int i = 0 ; i < SIZE ; ++ i ) assertEquals ( l . get ( i ) , new Integer ( i ) ) ; q . add ( zero ) ; q . add ( one ) ; assertFalse ( q . isEmpty ( ) ) ; assertTrue ( q . contains ( zero ) ) ; assertTrue ( q . contains ( one ) ) ; l . clear ( ) ; q . drainTo ( l ) ; assertEquals ( q . size ( ) , 0 ) ; assertEquals ( l . size ( ) , 2 ) ; for ( int i = 0 ; i < 2 ; ++ i ) assertEquals ( l . get ( i ) , new Integer ( i ) ) ; }
drainto ( c ) empties queue into another collection c
