code: public static boolean toBoolean(Object obj) {
          if (obj != null) {
              if (obj instanceof Boolean) {
                  return (Boolean)obj;
              } else {
                  return toBoolean(obj.toString());
              }
          } else {
              return false;
          }
      }
docs: Converts an object to boolean, according to the following logic:
  
  <ol>
  <li>If it's null, {@code false} is returned.</li>
  <li>If it's a Boolean, the same object is returned.</li>
  <li>If it's any other object, the {@code toString()} value is converted to boolean.</li>
  </ol>
  
  @param obj
  @return boolean value