@SuppressWarnings("unused")
	@Test
	public void testWordIterator() {
		//Create a few regions with text lines and words
		Page page = new Page();
		PageLayout pageLayout = page.getLayout();
		TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		TextLine t11 = r1.createTextLine();
		Word w111 = t11.createWord();
		
		Region r2 = pageLayout.createRegion(RegionType.ChartRegion);
		
		TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		
		TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		TextLine t41 = r4.createTextLine();
		Word w411 = t41.createWord();
		Word w412 = t41.createWord();
		TextLine t42 = r4.createTextLine();
		
		TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		
		TextRegion r6 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
		TextLine t61 = r6.createTextLine();
		Word w611 = t61.createWord();
		
		//Use iterator factory
		ContentIterator it = pageLayout.iterator(LowLevelTextType.Word);
		
		assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator);
		
		assertTrue("Word 111", it.hasNext() && it.next() == w111);
		assertTrue("Word 411", it.hasNext() && it.next() == w411);
		assertTrue("Word 412", it.hasNext() && it.next() == w412);
		assertTrue("Word 611", it.hasNext() && it.next() == w611);
		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.Word, layer);
		
		assertTrue("Word iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator);
		
		assertTrue("Word 411 (in layer)", it.hasNext() && it.next() == w411);
		assertTrue("Word 412 (in layer)", it.hasNext() && it.next() == w412);
		assertFalse("End it with layer filter", it.hasNext());
		
		//Layer (no matching region)
		layer.removeRegionRef(r4.getId().toString());
		it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Word, layer);
		assertTrue("Word iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator);
		assertFalse("End it with layer filter (no match)", it.hasNext());
	}