Add random simulation to verify correctitude of #<=>.