Code example for TreeSet

Methods: isEmpty

0
	 * @tests java.util.TreeSet#isEmpty() 
	 */ 
	public void test_isEmpty() { 
		// Test for method boolean java.util.TreeSet.isEmpty() 
		assertTrue("Empty set returned false", new TreeSet().isEmpty());
		assertTrue("Non-Empty returned true", !ts.isEmpty());
	} 
 
	/** 
	 * @tests java.util.TreeSet#iterator() 
	 */ 
	public void test_iterator() { 
		// Test for method java.util.Iterator java.util.TreeSet.iterator() 
		TreeSet s = new TreeSet();
		s.addAll(ts);
		Iterator i = ts.iterator();
		Set as = new HashSet(Arrays.asList(objArray));
		while (i.hasNext())
			as.remove(i.next());
		assertEquals("Returned incorrect iterator", 0, as.size());