public double probabilityOf(T key){
  Integer value=getCount(key);
  if (0 == total || 0 == value.intValue()) {
    return 0.0;
  }
 else {
    return value.doubleValue() / total;
  }
}

public double probabilityOf ( T key ) { Integer value = getCount ( key ) ; if ( 0 == total || 0 == value . intValue ( ) ) { return 0.0 ; } else { return value . doubleValue ( ) / total ; } }
returns the count to which the specified key is mapped in this frequency counter , divided by the total of all counts .
