@staticmethod
def get_algorithm(algorithms, algorithm_id):
    """
        From the list of algorithm classes provided, it tries to return an instance of the algorithm at algorithm_id
        :param algorithms: the list of algorithm classes
        :param algorithm: the position of the algorithm class in the list
        :return: instance of the algorithm or falls back to the first algorithm in the list
        """
    if algorithm_id < len(algorithms):
        return algorithms[algorithm_id]()
    return algorithms[0]()
