Optimal tests following sequential experiments