### Question:
QueryService { public Query createQuery(final String qls) { return entityManager.createQuery(qls); }  Query createQuery(final String qls); Query createQuery(final String qls, final Class<?> clazz); Query createNativeQuery(final String sql); Query createNativeQuery(final String sql, final Class<?> clazz);  }### Answer:
@Test public void createQuery() { assertNotNull(repository.save(EntityUtil.getSamplePermission())); final Query query = queryService.createQuery("select e from BPermission e"); assertNotNull(query); final List<?> resultList = query.getResultList(); assertNotNull(resultList); assertFalse(resultList.isEmpty()); }
@Test public void createQueryWithResultClass() { BPermission p = repository.save(EntityUtil.getSamplePermission()); assertNotNull(p); final Query query = queryService.createQuery("select e from BPermission e", BPermission.class); assertNotNull(query); final List<?> resultList = query.getResultList(); assertNotNull(resultList); assertFalse(resultList.isEmpty()); assertTrue(resultList.contains(p)); }