private static void writeDistribution(HashMap<Double, Integer> distribution, LinkedList<String> columns, int numberEntries, String baseFilename) throws IOException
	{
		//
		// Generate name for distribution
		//
		StringBuffer name = new StringBuffer();
		java.util.Collections.sort(columns);
		
		{
			boolean first = true;
			for(String col : columns) {
				if(first) first = false;
				else name.append("_");
				
				if(REMOVE_STRING_IN_OUTPUT_FILENAME != null) {
					col = col.replaceAll(REMOVE_STRING_IN_OUTPUT_FILENAME, "");
				}
				
				name.append(col);
			}
		}
		
		String filename = baseFilename +" " +name.toString() +".csv";
		FileWriter fw = new FileWriter(filename, false);
		
		//
		// Write header to file
		//
		fw.write("value" +SEPARATOR_OUT +"number" +SEPARATOR_OUT +"sum equal or smaller" +SEPARATOR_OUT +"percentage");
		fw.write(NEW_LINE);
		
		//
		// Write data to file
		//
		System.out.println("Write statistic to '" +filename +"'");
		System.out.println("  with " +distribution.size() +" entries");
		System.out.println("  lang " +OUTPUT_LANGUAGE);

		NumberFormat numberFormater = NumberFormat.getInstance(OUTPUT_LANGUAGE);
		numberFormater.setMaximumFractionDigits(MAX_FRACTION_DIGITS_IN_OUTPUT);
		
		List<Double> values = new ArrayList<Double>(distribution.keySet());
		java.util.Collections.sort(values);

		Integer numberSum = 0;
		for(Double value : values) {
			Integer number = distribution.get(value);
			
			numberSum += number;
			
			fw.write(numberFormater.format(value) +SEPARATOR_OUT +numberFormater.format(number) +SEPARATOR_OUT);
			fw.write(numberFormater.format(numberSum) +SEPARATOR_OUT +numberFormater.format((Double)(numberSum.doubleValue() / numberEntries)));
			fw.write(NEW_LINE);
		}

		fw.close();
		
		System.out.println("  sum value = " +numberSum +" (expected=" +numberEntries +")");
		
		if(numberSum != numberEntries) {
			System.err.println("Sum of values and number of entries does not match.");
		}
	}