docs: @Override
  	public double[] getHistogram(double[] intervalPoints)
  	{
  		double[] histogramValues = new double[intervalPoints.length+1];
  
  		if(isDeterministic()) {
  			/*
  			 * If the random variable is deterministic we will return an array
  			 * consisting of 0's and one and only one 1.
  			 */
  			java.util.Arrays.fill(histogramValues, 0.0);
  			for (int intervalIndex=0; intervalIndex<intervalPoints.length; intervalIndex++)
  			{
  				if(valueIfNonStochastic > intervalPoints[intervalIndex]) {
  					histogramValues[intervalIndex] = 1.0;
  					break;
  				}
  			}
  			histogramValues[intervalPoints.length] = 1.0;
  		}
  		else {
  			/*
  			 * If the random variable is deterministic we will return an array
  			 * representing a density, where the sum of the entries is one.
  			 * There is one exception:
  			 * If the size of the random variable is 0, all entries will be zero.
  			 */
  			float[] realizationsSorted = realizations.clone();
  			java.util.Arrays.sort(realizationsSorted);
  
  			int sampleIndex=0;
  			for (int intervalIndex=0; intervalIndex<intervalPoints.length; intervalIndex++)
  			{
  				int sampleCount = 0;
  				while (sampleIndex < realizationsSorted.length &&
  						realizationsSorted[sampleIndex] <= intervalPoints[intervalIndex])
  				{
  					sampleIndex++;
  					sampleCount++;
  				}
  				histogramValues[intervalIndex] = sampleCount;
  			}
  			histogramValues[intervalPoints.length] = realizationsSorted.length-sampleIndex;
  
  			// Normalize histogramValues
  			if(realizationsSorted.length > 0) {
  				for(int i=0; i<histogramValues.length; i++) {
  					histogramValues[i] /= realizationsSorted.length;
  				}
  			}
  		}
  
  		return histogramValues;
  	}