@Test
public void testRegisterationIdentity() throws Exception {

	String testString = new String("testString");
	MarkFinalizeAction markFinalizeAction = new MarkFinalizeAction();
	Reference<?> reference1 = FinalizeManager.register(
		testString, markFinalizeAction,
		FinalizeManager.SOFT_REFERENCE_FACTORY);
	Map<Object, FinalizeAction> finalizeActions =
		ReflectionTestUtil.getFieldValue(
			FinalizeManager.class, "_finalizeActions");
	Assert.assertEquals(
		finalizeActions.toString(), 1, finalizeActions.size());
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference1)));
	Reference<?> reference2 = FinalizeManager.register(
		testString, markFinalizeAction,
		FinalizeManager.SOFT_REFERENCE_FACTORY);
	Assert.assertEquals(reference1, reference2);
	Assert.assertNotSame(reference1, reference2);
	Assert.assertEquals(
		finalizeActions.toString(), 2, finalizeActions.size());
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference1)));
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference2)));
	reference2.clear();
	Assert.assertEquals(
		finalizeActions.toString(), 1, finalizeActions.size());
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference1)));
	reference2 = FinalizeManager.register(
		new String(testString), markFinalizeAction,
		FinalizeManager.SOFT_REFERENCE_FACTORY);
	Assert.assertEquals(
		finalizeActions.toString(), 2, finalizeActions.size());
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference1)));
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference2)));
	reference2.clear();
	Assert.assertEquals(
		finalizeActions.toString(), 1, finalizeActions.size());
	Assert.assertTrue(
		finalizeActions.containsKey(_newIdentityKey(reference1)));
	reference1.clear();
	Assert.assertTrue(
		finalizeActions.toString(), finalizeActions.isEmpty());
}