Add config examples of nearest_neighbor
Refactor cpp test of jenerator