Moved generateRandom to Utils and added test