@Test
  public void testEventQueue()
  {
    int maxCount = 10;
    TimeEvent e = null;
    EventQueue eq = new EventQueue();
    for ( int i = 0; i < maxCount; ++i ) {
      Integer info = new Integer(i);
      for ( int j = 0; j < 5; ++j ) {
	e = new TimeEvent(j, info);
	eq.enqueue(e);
      }
    }
    for ( int j = 0; j < 5; ++j ) {
      int i = 0;
      do {
	e = (TimeEvent) eq.dequeue(j);
	if ( e != null ) {
	  int type = e.type();
	  assertEquals(type, j);
	  ++i;
	}
      } while ( e != null );
      assertEquals(maxCount, i);
    }
  }