Replace class shim with a custom comparator.