test template for closest-neighbor-test