Non-iid hypothesis testing: from classical to quantum