Add equals method for comparing resources.