@Test
public void testManualClear() throws Exception {

	Object object1 = new Object();
	MarkFinalizeAction markFinalizeAction1 = new MarkFinalizeAction();
	Reference<Object> reference1 = FinalizeManager.register(
		object1, markFinalizeAction1,
		FinalizeManager.WEAK_REFERENCE_FACTORY);
	Map<Object, FinalizeAction> finalizeActions =
		ReflectionTestUtil.getFieldValue(
			FinalizeManager.class, "_finalizeActions");
	Assert.assertEquals(
		markFinalizeAction1,
		finalizeActions.get(_newIdentityKey(reference1)));
	reference1.clear();
	Assert.assertNull(finalizeActions.get(_newIdentityKey(reference1)));
	object1 = null;
	Object object2 = new Object();
	MarkFinalizeAction markFinalizeAction2 = new MarkFinalizeAction();
	Reference<Object> reference2 = FinalizeManager.register(
		object2, markFinalizeAction2,
		FinalizeManager.WEAK_REFERENCE_FACTORY);
	Assert.assertEquals(
		markFinalizeAction2,
		finalizeActions.get(_newIdentityKey(reference2)));
	reference1.enqueue();
	object2 = null;
	GCUtil.gc(true);
	_waitUntilMarked(markFinalizeAction2);
	Assert.assertFalse(markFinalizeAction1.isMarked());
}