private function getFilter(string $filterId): ?FilterInterface
    {
        if ($this->filterLocator instanceof ContainerInterface && $this->filterLocator->has($filterId)) {
            return $this->filterLocator->get($filterId);
        }

        if ($this->filterLocator instanceof FilterCollection && $this->filterLocator->offsetExists($filterId)) {
            return $this->filterLocator->offsetGet($filterId);
        }

        return null;
    }