### Question:
CustomerSampler implements Sampler<Customer> { public Customer sample() throws Exception { Integer id = idSampler.sample(); Pair<String, String> name = nameSampler.sample(); Store store = storeSampler.sample(); Location location = locationSampler.sample(store); return new Customer(id, name, store, location); } CustomerSampler(Sampler<Integer> idSampler,
			Sampler<Pair<String, String>> nameSampler,
			Sampler<Store> storeSampler,
			ConditionalSampler<Location, Store> locationSampler); Customer sample();  }### Answer:
@Test public void testBuild() throws Exception { SeedFactory factory = new SeedFactory(1234); List<Pair<String, String>> nameList = Lists.newArrayList(); nameList.add(Pair.of("Fred", "Fred")); nameList.add(Pair.of("Gary", "Gary")); nameList.add(Pair.of("George", "George")); nameList.add(Pair.of("Fiona", "Fiona")); List<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) }); List<Store> stores = new ArrayList<Store>(); for(int i = 0; i < zipcodes.size(); i++) { Store store = new Store(i, "Store_" + i, zipcodes.get(i)); stores.add(store); } Sampler<Integer> idSampler = new SequenceSampler(); Sampler<Pair<String, String>> nameSampler = RouletteWheelSampler.createUniform(nameList, factory); Sampler<Store> storeSampler = RouletteWheelSampler.createUniform(stores, factory); ConditionalSampler<Location, Store> zipcodeSampler = buildLocationSampler(stores, zipcodes, factory); Sampler<Customer> sampler = new CustomerSampler(idSampler, nameSampler, storeSampler, zipcodeSampler); Customer customer = sampler.sample(); assertNotNull(customer); assertTrue(customer.getId() >= 0); assertNotNull(customer.getName()); assertTrue(nameList.contains(customer.getName())); assertNotNull(customer.getLocation()); assertTrue(zipcodes.contains(customer.getLocation())); }