Useful methods for comparing objects.