// sample Queue usage
import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;
// ...
Queue<String> q = new ArrayBlockingQueue<String>( 10 );

// add element to queue
if ( ! q.offer( "pineapple" ) )
   {
   err.println( "queue is full" );
   }

// add another element to queue
q.offer( "papaya" );

// pop the first element off the queue.
String s = q.poll();
if ( s == null )
   {
   err.println( "queue is empty" );
   }