add unitTest for collision detection