boolean result = set.retainAll(set);
assertTrue("retain all should return false", !result);
assertEquals("did not retain all", 1000, set.size());
// send empty set to retainAll
result = set.retainAll(new TreeSet());
assertTrue("retain all should return true", result);
assertEquals("did not remove all elements in the map", 0, map.size());
assertTrue("did not remove all elements in the keyset", set.isEmpty());
Iterator it = set.iterator();