Add tests for sampling.