()
| 234 | * remove(x) removes x and returns true if present |
| 235 | */ |
| 236 | public void testRemoveElement() { |
| 237 | NavigableSet q = populatedSet(SIZE); |
| 238 | for (int i = 1; i < SIZE; i+=2) { |
| 239 | assertTrue(q.contains(i)); |
| 240 | assertTrue(q.remove(i)); |
| 241 | assertFalse(q.contains(i)); |
| 242 | assertTrue(q.contains(i-1)); |
| 243 | } |
| 244 | for (int i = 0; i < SIZE; i+=2) { |
| 245 | assertTrue(q.contains(i)); |
| 246 | assertTrue(q.remove(i)); |
| 247 | assertFalse(q.contains(i)); |
| 248 | assertFalse(q.remove(i+1)); |
| 249 | assertFalse(q.contains(i+1)); |
| 250 | } |
| 251 | assertTrue(q.isEmpty()); |
| 252 | } |
| 253 | |
| 254 | /* |
| 255 | * contains(x) reports true when elements added but not yet removed |
nothing calls this directly
no test coverage detected