ProbabilityDistributions { static public <T> Map<T, Double> generateConstantDistribution( Collection<T> objects, double value) { Map<T, Double> cd = new HashMap<T, Double>(); for (T object : objects) { cd.put(object, value); } return cd; }  static Double calculateLabelCost(String calcLabel,
			Map<String, Double> labelProbabilities, CostMatrix<String> costMatrix); static Map<T, Double> generateConstantDistribution(
		Collection<T> objects, double value); static Map<T, Double> generateUniformDistribution(
		Collection<T> objects); static Map<T, Double> generateUniformDistribution(
		Collection<T> objects, Map<T, Double> initialDistribution); static Map<String, Double> generateGoldDistribution(Collection<String> categories, String correctCat);  }
@Test public void testGenerateConstantDistribution() { Collection<String> objects = new LinkedList<String>(); for (int i = 0; i < 10; i++) { objects.add("" + i); } double value = Math.PI; Map<String, Double> result = ProbabilityDistributions.generateConstantDistribution( objects, value); for (String s : objects) { assertEquals(Math.PI, result.get(s), 0.0); } }