Testing for (in)finite moments