public function add($entry, $priority = self::DEFAULT_PRIORITY)
    {
        if (isset($this->entryClass) && !($entry instanceof $this->entryClass)) {
            throw new InvalidObjectClassException($this->entryClass, get_class($entry));
        }
        $this->entries[] = ['data' => $entry, 'priority' => $priority];
        $this->sorted = false;
        return $this;
    }