// Path: segment/src/main/java/net/loomchild/segment/TextIterator.java
// public interface TextIterator extends Iterator<String> {
// 
// 	/**
// 	 * @return next segment in text, or null if end of text has been
// 	 *         reached.
// 	 */
// 	public String next();
// 
// 	/**
// 	 * @return true if there are more segments
// 	 */
// 	public boolean hasNext();
// 
// 	/**
// 	 * Unsupported operation.
// 	 * 
// 	 * @throws UnsupportedOperationException
// 	 */
// 	public void remove();
// 
// }


import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import net.loomchild.segment.TextIterator;
import org.junit.Test;
		LanguageRule languageRule = new LanguageRule("");
		
		languageRule.addRule(new Rule(false, "\\sU\\.K\\.", "\\s"));
		languageRule.addRule(new Rule(false, "Mr\\.", "\\s"));
		languageRule.addRule(new Rule(true, "[\\.\\?!]+", "\\s"));

		SrxDocument document = new SrxDocument();
		document.addLanguageMap(".*", languageRule);

		return document;
	}
	
	/**
	 * Tests situation described in SRX specification as an example.
	 * The text is slightly shorter to decrease buffer size for tests.
	 */
	@Test
	public void testSpecificationExample() {
		performTest(SPECIFICATION_EXAMPLE_RESULT, 
				SPECIFICATION_EXAMPLE_DOCUMENT);
	}
	
	
	/**
	 * Create text iterator. This method needs to be implemented by inheriting.
	 * @param document SRX document
	 * @param languageCode language code of text
	 * @param text text to segment
	 * @return newly created text iterator
	 */
// Path: segment/src/main/java/net/loomchild/segment/TextIterator.java
// public interface TextIterator extends Iterator<String> {
// 
// 	/**
// 	 * @return next segment in text, or null if end of text has been
// 	 *         reached.
// 	 */
// 	public String next();
// 
// 	/**
// 	 * @return true if there are more segments
// 	 */
// 	public boolean hasNext();
// 
// 	/**
// 	 * Unsupported operation.
// 	 * 
// 	 * @throws UnsupportedOperationException
// 	 */
// 	public void remove();
// 
// }


// Path: segment/src/test/java/net/loomchild/segment/srx/AbstractSrxTextIteratorTest.java
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import net.loomchild.segment.TextIterator;
import org.junit.Test;

		LanguageRule languageRule = new LanguageRule("");
		
		languageRule.addRule(new Rule(false, "\\sU\\.K\\.", "\\s"));
		languageRule.addRule(new Rule(false, "Mr\\.", "\\s"));
		languageRule.addRule(new Rule(true, "[\\.\\?!]+", "\\s"));

		SrxDocument document = new SrxDocument();
		document.addLanguageMap(".*", languageRule);

		return document;
	}
	
	/**
	 * Tests situation described in SRX specification as an example.
	 * The text is slightly shorter to decrease buffer size for tests.
	 */
	@Test
	public void testSpecificationExample() {
		performTest(SPECIFICATION_EXAMPLE_RESULT, 
				SPECIFICATION_EXAMPLE_DOCUMENT);
	}
	
	
	/**
	 * Create text iterator. This method needs to be implemented by inheriting.
	 * @param document SRX document
	 * @param languageCode language code of text
	 * @param text text to segment
	 * @return newly created text iterator
	 */
	protected abstract TextIterator getTextIterator(SrxDocument document, 