use TotalEq for HashMap

Closes #5283