implement genericEquals