### Question:
PurchasingModelSamplerBuilder { public Sampler<? extends PurchasingModel> build() throws Exception { if(Constants.PURCHASING_MODEL_TYPE.equals(Constants.PurchasingModelType.MARKOV)) { return buildMarkovPurchasingModel(); } else { return new MultinomialPurchasingModelSampler(productCategories, seedFactory); } } PurchasingModelSamplerBuilder(Collection<ProductCategory> productCategories, SeedFactory seedFactory); Sampler<MarkovPurchasingModel> buildMarkovPurchasingModel(); Sampler<? extends PurchasingModel> build();  }### Answer:
@Test public void testBuild() throws Exception { SeedFactory seedFactory = new SeedFactory(1245); List<ProductCategory> productCategories = createProducts(); PurchasingModelSamplerBuilder builder = new PurchasingModelSamplerBuilder(productCategories, seedFactory); Sampler<MarkovPurchasingModel> sampler = builder.buildMarkovPurchasingModel(); MarkovPurchasingModel profile = sampler.sample(); assertNotNull(profile); assertNotNull(profile.getProductCategories()); assertTrue(profile.getProductCategories().size() > 0); for(String label : profile.getProductCategories()) { assertNotNull(profile.getProfile(label)); assertNotNull(profile.getProfile(label).getStartWeights()); assertTrue(profile.getProfile(label).getStartWeights().size() > 0); assertNotNull(profile.getProfile(label).getTransitionWeights()); assertTrue(profile.getProfile(label).getTransitionWeights().size() > 0); } }