Changed the test such that the reference data shows a very simple pattern.
@wenqing, I rebased your branch before I added my changes on top. It saved me a lot of rebuild time. Therefore, there are so many commits in this MR. They should go away if you rebase your branch.