Compare object for equality rather than for reference