You have to override your equals method in your Dog class. If not you are just comparing if those objects are the same instance in memory.
Here is an implementation of how to do this:
class Dog{
int height;
int weight;
String name;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Dog)) return false;
Dog dog = (Dog) o;
if (height != dog.height) return false;
if (weight != dog.weight) return false;
return name != null ? name.equals(dog.name) : dog.name == null;
}
}