Compare hash in Reference.equals