### Question:
StoreLocationPopulationPDF implements ProbabilityDensityFunction<Location> { public double probability(Location record) { return ((double) record.getPopulation()) / populationSum; } StoreLocationPopulationPDF(List<Location> zipcodeTable); double probability(Location record);  }### Answer:
@Test public void testProbability() throws Exception { 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) }); StoreLocationPopulationPDF pdf = new StoreLocationPopulationPDF(zipcodes); for(Location record : zipcodes) { assertTrue(pdf.probability(record) > 0.0); } }