title: Mockito QueryDSL
body: <p>I have a method that uses queryDSL for query generation.</p>
  <pre><code>public List&lt;EntityDAO&gt; getObject() {
          QEntity entity = QEntity.entity;
          JPAQueryFactory queryFactory = getJPAQueryFactory();
  
          JPAQuery&lt;EntityDAO&gt; query = queryFactory
                               .select(Projections.bean(EntityDAO.class, 
                                entity.propertyA,
                                entity.propertyB.count().as(&quot;count&quot;)))
                               .from(entity)
                               .where(predicateBuilder.build())
                               .groupBy(entity.propertyA)
                               .orderBy(order)
                               .limit(rowCount)
                               .offset(pageId*rowCount);
         return query.fetch();
  }
  </code></pre>
  <p>How can I test this method using Mockito?</p>