  Baum-Katz theorem asserts that the Cesaro means of i.i.d. increments
distributed like X r-converge if and only if |X|^{r+1} is integrable. We
generalize this, and we unify other results, by proving that the following
equivalence holds, if and only if G is moderate: the Cesaro means G-converge if
and only if G(L(a)) is integrable for every a if and only if |X|.G(|X|) is
integrable. Here, L(a) is the last time when the deviation of the Cesaro mean
from its limit exceeds a, and G-convergence is the analogue of r-convergence.
This solves a question about the asymptotic optimality of Wald's sequential
tests.
