Add stateful generator example