@Test
public void testRandomCoverage() {

	try {
		System.out.println("Testing random coverage" + "\n");
		boolean stdOutput = true;
		boolean fileOutput = false;
		final int totalCount = 10000;
		final NamedType nt = NamedType.INT;
		final int minI = -128;
		final int maxI = 127;		
		final BigFraction min = new BigFraction(BigInteger.valueOf(minI));
		final BigFraction max = new BigFraction(BigInteger.valueOf(maxI));
		ArrayList<Integer> bias = new ArrayList<Integer>();
		bias.add(-1);
		bias.add(0);
		bias.add(1);
		int aBias;
		ArrayList<Integer> missing = new ArrayList<Integer>();
		for(int bIndex = 0; bIndex < bias.size(); bIndex++){
			aBias = bias.get(bIndex);
			if(stdOutput){
				System.out.println("bias: " + aBias);
			}
			BufferedWriter myOut = null;
			if(fileOutput){
				String myFileName = buildOutputFilename("random_freq_", aBias, totalCount);
				String rangeString = "_range_" + min + "--" + max;
				String typeString = "_type-" + nt.toString();
				myFileName = myFileName.concat(rangeString).concat(typeString).concat(".txt");
				myOut = new BufferedWriter(new FileWriter(myFileName));
				System.out.println(myFileName + "\n");
			}
			HashMap<Integer,Integer> hm = new HashMap<Integer, Integer>();
			for(int i = 0; i < totalCount; i += 1){
				BigFraction resBF = Rat.biasedRandom(nt, true, aBias, min, max);
				double res = resBF.doubleValue();
				if(hm.containsKey((int)res)){
					Integer freq = hm.get((int)res);
					freq = freq + 1;
					hm.put((int)res, freq);
				}
				else
				{
					hm.put((int)res, 1);
				}
			} // end for totalCount
			// output frequencies to file, one value per line.  format:  value, frequency 
			if(fileOutput){
				for(int i = minI; i <= maxI; i++){
					if(hm.containsKey(i)){
						int freq = hm.get(i);
						myOut.write(i + ", " + freq + "\n");
					}
					else
						myOut.write(i + ", " + 0 + "\n");
				}
			} // end if stdOutput
			if(! (myOut==null)){
				myOut.close();				
			}
			for(int i = minI; i <= maxI; i++){
				if(! hm.containsKey(i))
					missing.add(i);		
			}
			if(stdOutput){
				System.out.println("missing count: " + missing.size());
				System.out.println("missing: \n" + missing + "\n");
			}
			// test conditions:  Ensure we always produce min and max values.
			Assert.assertFalse(missing.contains(minI));
			Assert.assertFalse(missing.contains(maxI));
			missing.clear();
		} // end for bIndex
	} catch (Throwable e) {
		throw new Error(e);
	}
}