Code example for TreeSet

Methods: contains, remove, size

0
	/** 
	 * @tests java.util.TreeSet#remove(java.lang.Object) 
	 */ 
	public void test_removeLjava_lang_Object() { 
		// Test for method boolean java.util.TreeSet.remove(java.lang.Object) 
		ts.remove(objArray[0]);
		assertTrue("Failed to remove object", !ts.contains(objArray[0]));
		assertTrue("Failed to change size after remove",
				ts.size() == objArray.length - 1);
		try { 
			ts.remove(new Object());
		} catch (ClassCastException e) {
			// Correct 
			return; 
		} 
		fail("Failed to throw exception when past uncomparable value");
	} 
 
	/** 
	 * @tests java.util.TreeSet#size() 
	 */