private function prepare(
        SpecificationInterface $specification,
        EntityManager $entityManager,
        QueryBuilder $queryBuilder,
        AbstractQuery $query
    ) {
        $entityManager->createQueryBuilder()->willReturn($queryBuilder);

        $specification->modify($queryBuilder, $this->dqlAlias)->willReturn($this->expression);

        $queryBuilder->select($this->dqlAlias)->willreturn($queryBuilder);
        $queryBuilder->from(Argument::any(), $this->dqlAlias, Argument::any())->willReturn($queryBuilder);
        $queryBuilder->where($this->expression)->willReturn($queryBuilder);

        $queryBuilder->getQuery()->willReturn($query);

        $query->execute()->willReturn($this->result);
    }