assertEquals( p.asText().trim(), "Below is an unordered list, followed by six paragraphs." );
HtmlUnorderedList ul = (HtmlUnorderedList) elementIterator.next();
assertNotNull( ul );
HtmlListItem li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 1." );
ul = (HtmlUnorderedList) elementIterator.next();
assertNotNull( ul );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.getFirstChild().asText().trim(), "Item 11." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.getFirstChild().asText().trim(), "Item 12." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 13." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 14." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 2." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 3." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 4." );
ul = (HtmlUnorderedList) elementIterator.next();
assertNotNull( ul );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 41." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 42." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 43." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 44." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 1 below list." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 2 below list." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 3 below list." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 4 below list." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 5 below list." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 6 below list." );
// ----------------------------------------------------------------------
// Ordered lists
// ----------------------------------------------------------------------
div = (HtmlDivision) elementIterator.next();
assertNotNull( div );
assertEquals( div.getAttribute( "class" ), "section" );
h4 = (HtmlHeading4) elementIterator.next();
assertNotNull( h4 );
assertEquals( h4.asText().trim(), "Ordered lists" );
a = (HtmlAnchor) elementIterator.next();
assertNotNull( a );
assertEquals( a.getAttribute( "name" ), "Ordered_lists" );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Below is an ordered list, followed by six paragraphs." );
HtmlOrderedList ol = (HtmlOrderedList) elementIterator.next();
assertNotNull( ol );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 1." );
ol = (HtmlOrderedList) elementIterator.next();
assertNotNull( ol );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 11." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 12." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 13." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 14." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 2." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 3." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 4." );
ol = (HtmlOrderedList) elementIterator.next();
assertNotNull( ol );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 41." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 42." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 43." );
li = (HtmlListItem) elementIterator.next();
assertNotNull( li );
assertEquals( li.getFirstChild().asText().trim(), "Item 44." );
p = (HtmlParagraph) elementIterator.next();
assertNotNull( p );
assertEquals( p.asText().trim(), "Paragraph 1 below list." );
p = (HtmlParagraph) elementIterator.next();