@Test public void testToBoolean06() { assertEquals(true, ToBoolean(" ")); assertEquals(true, ToBoolean("Nonempty String")); }
static Boolean ToBoolean(Object arg) { if (arg == null) { return Boolean.FALSE; } else if (arg instanceof Boolean) { return (Boolean) arg; } else if (arg instanceof Number) { double value = ((Number) arg).doubleValue(); return !(Double.isNaN(value) || value == 0.0); } else if (arg instanceof String) { return !"".equals(arg); } return true; }
JSAbstractOperations { static Boolean ToBoolean(Object arg) { if (arg == null) { return Boolean.FALSE; } else if (arg instanceof Boolean) { return (Boolean) arg; } else if (arg instanceof Number) { double value = ((Number) arg).doubleValue(); return !(Double.isNaN(value) || value == 0.0); } else if (arg instanceof String) { return !"".equals(arg); } return true; } }
JSAbstractOperations { static Boolean ToBoolean(Object arg) { if (arg == null) { return Boolean.FALSE; } else if (arg instanceof Boolean) { return (Boolean) arg; } else if (arg instanceof Number) { double value = ((Number) arg).doubleValue(); return !(Double.isNaN(value) || value == 0.0); } else if (arg instanceof String) { return !"".equals(arg); } return true; }  }
JSAbstractOperations { static Boolean ToBoolean(Object arg) { if (arg == null) { return Boolean.FALSE; } else if (arg instanceof Boolean) { return (Boolean) arg; } else if (arg instanceof Number) { double value = ((Number) arg).doubleValue(); return !(Double.isNaN(value) || value == 0.0); } else if (arg instanceof String) { return !"".equals(arg); } return true; }   }
JSAbstractOperations { static Boolean ToBoolean(Object arg) { if (arg == null) { return Boolean.FALSE; } else if (arg instanceof Boolean) { return (Boolean) arg; } else if (arg instanceof Number) { double value = ((Number) arg).doubleValue(); return !(Double.isNaN(value) || value == 0.0); } else if (arg instanceof String) { return !"".equals(arg); } return true; }   static final BigInteger UINT_MAX_VALUE; static final Double UINT_MAX_VALUE_D; static final BigInteger SINT_MAX_VALUE; static final BigInteger USHORT_MAX_VALUE; }