They're equal if this is the same type of event and the same id
Allows to know if an event concerns a same type of action on the same object.
Very useful to delete doubles.

@param  Event $event
@return boolean
435123
public function isEqual(Event $event)
    {
        try {
            return $this->getName() === $event->getName()
            && $this->get('id') === $event->get('id')
            && self::getSortedKeys($this->getParameters()) === self::getSortedKeys($event->getParameters());
        } catch (\Exception $e) {
        }

        return false;
    }
668155
private function isEventDelayedUntilFirstBackgroundPrinted(Event $event)
    {
        if (!$event instanceof ScenarioTested && !$event instanceof OutlineTested && !$event instanceof ExampleTested) {
            return false;
        }

        return !$this->firstBackgroundEnded && $event->getFeature()->hasBackground();
    }
39482
public static function isEqual($a, $b)
    {
        if ($a === $b) {
            return true;
        } elseif ($a instanceof \stdClass) {
            return self::isEqual((array) $a, $b);
        } elseif ($b instanceof \stdClass) {
            return self::isEqual($a, (array) $b);
        } else {
            return false;
        }
    }
1179406
public static function duplicateEntity(DuplicateEntity $event)
    {
        if ($event->getWithoutKeys()) {
            $entity = $event->getEntity();

            if (isset($GLOBALS['TL_DCA'][$entity->entityTableName()]['fields'])) {
                /** @var EntityAccessor $entityAccessor */
                $entityAccessor = $GLOBALS['container']['doctrine.orm.entityAccessor'];

                $fields = (array) $GLOBALS['TL_DCA'][$entity->entityTableName()]['fields'];
                foreach ($fields as $field => $fieldConfig) {
                    if (isset($fieldConfig['field']['timestampable'])) {
                        $entityAccessor->setRawProperty($entity, $field, null);
                    }
                }
            }
        }
    }
600545
public boolean sameEventClass(XEvent eventA, XEvent eventB) {
		return getClassIdentity(eventA).equals(getClassIdentity(eventB));
	}
296976
public static boolean eventsEqual(@Nullable final List<CommonEvent> eventsA, @Nullable final List<CommonEvent> eventsB) {
        if ((eventsA == null) && (eventsB == null)) {
            return true;
        }
        if ((eventsA == null) && (eventsB != null)) {
            return false;
        }
        if ((eventsA != null) && (eventsB == null)) {
            return false;
        }
        if (eventsA.size() != eventsB.size()) {
            return false;
        }
        int currentIdx = eventsA.size() - 1;
        int appendIdx = eventsB.size() - 1;
        while (appendIdx >= 0) {
            final CommonEvent current = eventsA.get(currentIdx);
            final CommonEvent append = eventsB.get(appendIdx);
            if (!current.equals(append)) {
                return false;
            }
            currentIdx--;
            appendIdx--;
        }
        return true;
    }
1005468
private function shouldHandle($event)
    {
        if ($event instanceof TransactionalEvent) {
            return true;
        }

        $event = is_string($event) ? $event : get_class($event);

        foreach ($this->excluded as $excluded) {
            if ($this->matches($excluded, $event)) {
                return false;
            }
        }

        foreach ($this->transactional as $transactionalEvent) {
            if ($this->matches($transactionalEvent, $event)) {
                return true;
            }
        }

        return false;
    }
466412
public function doUnserialize(EventInterface $event)/*# : bool */
    {
        /* @var CacheItem $item */
        $item = $event->getParam('item');
        $val = @unserialize($item->getStrVal());
        if (false !== $val) {
            $item->set($val);
        }
        return true;
    }
602331
protected function isEventTypeOf(string $eventType): bool
    {
        $header = $this->getEventType();

        return strpos($header, $eventType) === 0;
    }
563016
private function isSkippableEvent(Event $event)
    {
        if (!$this->firstBackgroundEnded) {
            return false;
        }

        return $event instanceof BackgroundTested || $this->isNonFailingConsequentBackgroundStep($event);
    }
1158776
public function hasEvent($event) {
		return (bool) check_entity_relationship($event->guid, self::EVENT_CALENDAR_RELATIONSHIP, $this->guid);
	}
132665
private function isEventSupported(Event $event): bool
    {
        $supported = false;

        foreach ($this->getSupportedEventTypes() as $supportedEventType) {
            if (\is_a($event, $supportedEventType)) {
                $supported = true;

                break;
            }
        }

        return $supported;
    }
1262693
public function handle($event)
    {
        switch (get_class($event)) {
            case AfterMassActionsAction::class:
                $actions = $event->massActions;
                $row = $event->model;
                break;

            case BeforeMassActionsAction::class:
                $actions = $event->massActions;
                $row = $event->model;
                break;

            case AfterTableAction::class:
                $actions = $event->tableActions;
                $row = $event->row;
                break;

            case BeforeTableAction::class:
                $actions = $event->tableActions;
                $row = $event->row;
                break;
        }

        $elements = $this->getActions($row);
        $return   = [];

        foreach ($elements as $element) {
            $resolved = $this->resolveDatatableAction($actions, $row, $element);
            if (is_array($resolved)) {
                $return[] = $resolved;
            }
        }


        return count($return) ? array_merge(...$return) : [];
    }
1077632
public boolean isDeathRelatedEvent(final Attribute event) {
        if (isDeathEvent(event)) {
            return true;
        }
        if (isPostDeathEvent(event)) {
            return true;
        }
        return isUnorderedEvent(event);
    }
1308059
public function trigger($event)
    {
        $result = false;
        if (isset(self::$event[$event])) {
            $result = call_user_func_array(self::$event[$event], [$this]);
        }

        return $result;
    }
302340
protected function equal($key)
    {
        if ($this->before($key) !== $this->after($key)) {
            return false;
        }

        $diff = [
            'key' => $key,
            'value' => $this->before($key),
            'type' => 'equal',
        ];

        return (object) $diff;
    }
1173502
public function match(string $pattern, Event $event) : bool
    {
        return $this->matchEventName($pattern, $event);
    }