IntermediateDAO { public List<Intermediate> list(Integer pageNum, Integer numResults) { Session session = sessionFactory.openSession(); session.beginTransaction(); Criteria criteria = session.createCriteria(Intermediate.class); criteria.setFirstResult(pageNum); criteria.setMaxResults(numResults); List<Intermediate> intermediates = criteria.list(); session.getTransaction().commit(); session.close(); return intermediates; }  List<Intermediate> list(Integer pageNum, Integer numResults); Long totalRecordCount(); Intermediate get(IntermediateId intermediateId); IntermediateId insert(Intermediate intermediate); void update(Intermediate intermediate); void delete(IntermediateId intermediateId);  }
@Ignore @Test public void testList() throws Exception { LOGGER.info("Size of intermediate list is atleast:" + intermediateDAO.list(0, 10).size()); }