@SuppressWarnings("unused")
	@Test
	public void testTextLineIteratorWithNesting() {
		//Create a few regions with text lines: tr1, cr2 (tr3,tr4), tr5 (tr6)
		Page page = new Page();
		PageLayout pageLayout = page.getLayout();
		TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		TextLine t11 = r1.createTextLine();
		
		Region r2 = pageLayout.createRegion(RegionType.ChartRegion);
		TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r2);
		TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r2);
		TextLine t41 = r4.createTextLine();
		TextLine t42 = r4.createTextLine();
		
		TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		TextRegion r6 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r5);
		TextLine t61 = r6.createTextLine();
		
		//Use iterator factory
		ContentIterator it = pageLayout.iterator(LowLevelTextType.TextLine);
		
		assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator);
		
		assertTrue("Line 11", it.hasNext() && it.next() == t11);
		assertTrue("Line 41", it.hasNext() && it.next() == t41);
		assertTrue("Line 42", it.hasNext() && it.next() == t42);
		assertTrue("Line 51", it.hasNext() && it.next() == t61);
		assertFalse("End", it.hasNext());
		
		//Layer
		pageLayout.createLayers();
		Layer layer = pageLayout.getLayers().createLayer();
		layer.addRegionRef(r2.getId().toString());
		layer.addRegionRef(r4.getId().toString());
		layer.addRegionRef(r5.getId().toString());
		
		it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer);
		
		assertTrue("Text line iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator);
		
		assertTrue("Line 41 (in layer)", it.hasNext() && it.next() == t41);
		assertTrue("Line 42 (in layer)", it.hasNext() && it.next() == t42);
		assertFalse("End it with layer filter", it.hasNext());

		//Layer (no matching region)
		layer.removeRegionRef(r4.getId().toString());
		layer.removeRegionRef(r5.getId().toString());
		it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer);
		assertTrue("Text line iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator);
		assertFalse("End it with layer filter (no match)", it.hasNext());
	}