Complete datagen implementation.
Accurate test case and expectations.