private static void chiSquareTestOnFile(Path path, HashFunction func) {
		Vector<Double> values = new Vector<Double>();
		for (String w : new WordReader(path))
			values.add((double) func.hashString(w) );

		// Convert the Vector<Double> into an array of doubles
		int i = 0;
		double[] tab = new double[values.size()];
		for (Double d : values) {
			tab[i] = d.doubleValue();
			i++;
		}

		// Number of bins in the histogram
		int bins = 100;
		// Frequencies of the hash values (doubles)
		double[] freq = histogram(tab, min(tab), max(tab), bins);
		// Array of longs. To cast from freq.
		long[] frequencies = new long[bins];
		// Expected frequencies.
		double[] expected = new double[bins];
		for (int j = 0; j < bins; j++) {
			// Cast
			frequencies[j] = (long) freq[j];
			// Expected frequencies for a uniform distribution on the hash
			// values
			expected[j] = tab.length / bins;
		}

		// Chi2 test from the Apache commons math package.
		ChiSquareTest chi = new ChiSquareTest();
		
		System.out.println("Result of a chi-square test with confidence level of 95% :");
		// Returns true if the null hypothesis (that the observed counts
		// conform
		// to the frequency
		// distribution described by the expected counts) can be
		// rejected with
		// 100 * (1 - alpha)
		// percent confidence. We choose alpha = 0.05.
		System.out.println("	" + Boolean.toString(!chi.chiSquareTest(expected, frequencies, 0.05)));
		System.out.println("The p-value is");
		System.out.println("	"  + chi.chiSquareTest(expected, frequencies));
	}