Code example for StringTokenizer

Methods: hasMoreElements, nextElement

0
	 * @tests java.util.StringTokenizer#hasMoreElements() 
	 */ 
	public void test_hasMoreElements() { 
		// Test for method boolean java.util.StringTokenizer.hasMoreElements() 
 
		StringTokenizer st = new StringTokenizer("This is a test String");
		st.nextElement();
		assertTrue("hasMoreElements returned incorrect value", st
				.hasMoreElements());
		st.nextElement();
		st.nextElement();
		st.nextElement();
		st.nextElement();
		assertTrue("hasMoreElements returned incorrect value", !st
				.hasMoreElements());
	} 
 
	/** 
	 * @tests java.util.StringTokenizer#hasMoreTokens() 
	 */ 
	public void test_hasMoreTokens() {