Fix test for References
Added the BaseEntity#immutable method to return an immutable copy of the BaseEntity