static public boolean coinToss(Probability probability) {
        double p = probability.value;
        double toss = RandomUtils.pickRandomProbability();  // returns [0.0..1.0) so will never be 1.0
        return p > toss;
    }
static public boolean coinToss ( Probability probability ) { double p = probability . value ; double toss = RandomUtils . pickRandomProbability ( ) ; return p > toss ; }
This function returns the result of a coin toss that is weighted with the
specified probability.  A probability of zero will always return false and
a probability of one will always return true.

@param probability The probability of the weighted coin.
@return The result of the coin toss.