Generalized the collision test