adding weakidentitymap with tests.