Added a test to ensure that sampling is working as expected.