@Test
	public void testAddAndRemove() {
		WeakSet<String> weakSet = WeakDataStructureFactory.createCopyOnWriteWeakSet();

		String[] values = { "one", "two", "three" };

		// test add
		for (int i = 0; i < values.length; i++) {
			weakSet.add(values[i]);

			assertTrue("The weak set does not contain the correct number of " +
				"elements after calling add().", ((i + 1) == weakSet.size()));
		}

		// now test remove
		for (int i = 0; i < values.length; i++) {
			weakSet.remove(values[i]);

			assertTrue(
				"The weak set does not contain the correct number " +
					"of elements after calling remove().",
				((values.length - (i + 1)) == weakSet.size()));
		}
	}
Tests the {@link WeakSet} class.


@since  Tracker Id 522
Ghidra/Framework/Generic/src/test/java/ghidra/util/datastruct/WeakSetTest.java