Add example for NewGenerator.