code: public static boolean parseBoolean(Object val)
    {
      if (val instanceof String) {
        return Boolean.parseBoolean((String) val);
      } else if (val instanceof Boolean) {
        return (boolean) val;
      } else {
        if (val == null) {
          throw new NullPointerException("Input is null");
        } else {
          throw new ISE("Unknown type [%s]", val.getClass());
        }
      }
    }
docs: Parse the given object as a {@code boolean}. The input object can be a {@link String} or {@link Boolean}.
  
  @return {@code true} only if the input is a {@link Boolean} representing {@code true} or a {@link String} of
  {@code "true"}.
  
  @throws NullPointerException if the input is null.
  @throws ISE if the input is not a string or a number.