Add nested class CollisionDetector