Use getId() instead of accessing id directly for Identity objects.