Iterator<?>[] iterators = new Iterator<?>[]
{ Collections.singleton( "foo0" ).iterator(), multivalued.iterator(),
Collections.singleton( "bar0" ).iterator(), Collections.singleton( "bar1" ).iterator() };
JoinIterator iterator = new JoinIterator( iterators );
assertTrue( "iterator should have an element", iterator.hasNext() );
assertEquals( "foo0", iterator.next() );
assertTrue( "iterator should have an element", iterator.hasNext() );
assertEquals( "foo1", iterator.next() );
assertTrue( "iterator should have an element", iterator.hasNext() );
assertEquals( "foo2", iterator.next() );
assertTrue( "iterator should have an element", iterator.hasNext() );
assertEquals( "bar0", iterator.next() );
assertTrue( "iterator should have an element", iterator.hasNext() );
assertEquals( "bar1", iterator.next() );
assertFalse( "iterator should NOT have an element", iterator.hasNext() );
}