public static boolean asBoolean(Number number){
  return number.doubleValue() != 0;
}

public static boolean asBoolean ( Number number ) { return number . doubleValue ( ) != 0 ; }
coerce a number to a boolean value . a number is coerced to false if its double value is equal to 0 , and to true otherwise , and to true otherwise .
