public void testSegment() throws Exception {
TextSegmenter ts = new TextSegmenter( "foobarbazbeebob", "[", "]" );
assertTrue( !ts.hasMoreSegments() );
assertEquals( null, ts.nextSegment() );
ts.replaceSegment( "X" );
assertTrue( "foobarbazbeebob".equals( ts.getReplacedContent() ) );
ts = new TextSegmenter( "foobarbazbeebob", "[", "]" );
assertTrue( !ts.hasMoreSegments() );
assertTrue( "foobarbazbeebob".equals( ts.getReplacedContent() ) );