### Question:
StoreSampler implements Sampler<Store> { public Store sample() throws Exception { Integer id = idSampler.sample(); String name = "Store_" + id; Location location = locationSampler.sample(); Store store = new Store(id, name, location); return store; } StoreSampler(Sampler<Integer> idSampler, Sampler<Location> locationSampler); Store sample();  }### Answer:
@Test public void testSampler() throws Exception { Collection<Location> zipcodes = Arrays.asList(new Location[] { new Location("11111", Pair.of(1.0, 1.0), "AZ", "Tempte", 30000.0, 100), new Location("22222", Pair.of(2.0, 2.0), "AZ", "Phoenix", 45000.0, 200), new Location("33333", Pair.of(3.0, 3.0), "AZ", "Flagstaff", 60000.0, 300) }); SeedFactory factory = new SeedFactory(1234); Sampler<Store> sampler = new StoreSampler(new SequenceSampler(), RouletteWheelSampler.createUniform(zipcodes, factory)); Store store = sampler.sample(); assertNotNull(store); assertTrue(store.getId() >= 0); assertNotNull(store.getName()); assertNotNull(store.getLocation()); }