added SampleWithSeed
sample_test uses deterministic seeding for reproducibility