private static boolean randomTest(
            Random a_Random,
            BigDecimal probability,
            BigDecimal minTestValue,
            BigDecimal maxTestValue,
            BigDecimal midTestValue,
            BigDecimal half_BigDecimal,
            BigDecimal two_BigDecimal,
            MathContext a_MathContext) {
        if (probability.compareTo(midTestValue) == 0) {
            return a_Random.nextBoolean();
        }
        boolean above = a_Random.nextBoolean();
        if (above) {
            if (probability.compareTo(midTestValue) == 1) {
                // Test
                BigDecimal newMinTestValue = midTestValue;
                BigDecimal newMidTestValue = divideRoundIfNecessary(
                        newMinTestValue.add(maxTestValue),
                        two_BigDecimal,
                        a_MathContext);
                return randomTest(
                        a_Random,
                        probability,
                        newMinTestValue,
                        maxTestValue,
                        newMidTestValue,
                        half_BigDecimal,
                        two_BigDecimal,
                        a_MathContext);
            } else {
                return false;
            }
        } else {
            if (probability.compareTo(midTestValue) == 1) {
                return true;
            } else {
                //Test
                BigDecimal newMaxTestValue = midTestValue;
                BigDecimal newMidTestValue = divideRoundIfNecessary(
                        newMaxTestValue.add(minTestValue),
                        two_BigDecimal,
                        a_MathContext);
                return randomTest(
                        a_Random,
                        probability,
                        minTestValue,
                        newMaxTestValue,
                        newMidTestValue,
                        half_BigDecimal,
                        two_BigDecimal,
                        a_MathContext);
            }
        }
    }

//    /**
//     * Effectively this is the same as generating a random number between 0 and
//     * 1 and comparing it with probability and if it were higher then return
//     * false and otherwise return true
//     * @param a_Random
//     * @param probability
//     * @return true or false based on a random uniform test of probability
//     */
//    public static boolean randomUniformTest(
//            Random a_Random,
//            BigDecimal probability) {
//        BigDecimal testValue0 = new BigDecimal("0.5");
//        BigDecimal testValue1;
//        BigDecimal two_BigDecimal = new BigDecimal("2.0");
//        boolean test;
//        do {
//            test = a_Random.nextBoolean();
//            if (test) {
//                if (probability.compareTo(testValue0) != -1) {
//                    return false;
//                } else {
//                    testValue1 = testValue0.divide(two_BigDecimal);
//                    if (probability.compareTo(testValue1) == 1) {
//                        return true;
//                    }
//                    testValue0 = testValue1;
//                }
//            } else {
//                return false;
//            }
//        } while (true);
//    }