private static function matchesArrayCriteria($key, $object, array $criteria)
    {
        $criteria = self::extractArrayCriteria($key, $criteria);

        if (count($criteria) === 0) {
            return true;
        }

        $getter = sprintf('get%s', ucfirst($key));

        if (!method_exists($object, $getter)) {
            throw new RuntimeException(sprintf('Object instance of "%s" does not have required getter "%s" to be used for filtering.', get_class($object), $getter));
        }

        return in_array($object->{$getter}(), $criteria, true);
    }