Code example for TreeSet

Methods: first

0
	 * @tests java.util.TreeSet#first() 
	 */ 
	public void test_first() { 
		// Test for method java.lang.Object java.util.TreeSet.first() 
		assertTrue("Returned incorrect first element",
				ts.first() == objArray[0]);
	} 
 
	/** 
	 * @tests java.util.TreeSet#headSet(java.lang.Object) 
	 */ 
	public void test_headSetLjava_lang_Object() { 
		// Test for method java.util.SortedSet 
		// java.util.TreeSet.headSet(java.lang.Object) 
		Set s = ts.headSet(new Integer(100));
		assertEquals("Returned set of incorrect size", 100, s.size());
		for (int i = 0; i < 100; i++)
			assertTrue("Returned incorrect set", s.contains(objArray[i]));
	} 
 
	/**