NateS solution for ObjectMap and IdentityMap.