code: public function adapterHasBehavior(Adapter $adapter, $behavior)
      {
          if ($adapter instanceof KnowsItsBehaviors) {
              return in_array($behavior, $adapter->getBehaviors());
          }
  
          return true === is_a($adapter, $behavior);
      }
docs: Say if adapter has the given behavior.
  
  @param Adapter $adapter
  @param string  $behavior
  
  @return bool