Ported CollisionAlgorithmCreateFunc to scala