code: public static function castFrom($predicate)
      {
          if ($predicate instanceof self) {
              return $predicate;
          } elseif (is_callable($predicate)) {
              return new CallablePredicate($predicate);
          }
  
          throw new \InvalidArgumentException(
                  'Given predicate is neither a callable nor an instance of ' . __CLASS__
          );
      }
docs: casts given predicate to a predicate instance
  
  @param   \stubbles\predicate\Predicate|callable  $predicate
  @return  \stubbles\predicate\Predicate
  @throws  \InvalidArgumentException