Javadoc Set:
Note. Great care should be taken if mutable objects are used as specified elements. The behavior of the set is not indicated if the value of the object changes in a way that affects equal comparisons when the object is an element in the set.
By writing
dog1.name = "dodo2"
you did just that, you changed the object in a way that affects comparisons equals. In particular, using the construction
set.removeAll { true }
LinkedHashSet, , , , set.remove(it). it -, , , . LinkedHashSet - it.