Finished coding generator example and added tests.
Added tests for generator version.