### Question:
RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsImpl(ConnectionSource connectionSource, DatabaseConnection connection, String query,
			Class<?> clazz, CompiledStatement compiledStmt, GenericRowMapper<T> rowMapper, ObjectCache objectCache); @Override int getNumberColumns(); @Override String[] getColumnNames(); @Override List<T> getResults(); @Override T getFirstResult(); @Override CloseableIterator<T> iterator(); @Override CloseableIterator<T> closeableIterator(); @Override void close();  }### Answer:
@Test public void testQueryRawColumns() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); Foo foo1 = new Foo(); foo1.val = 1; foo1.equal = 10; assertEquals(1, dao.create(foo1)); Foo foo2 = new Foo(); foo2.val = 10; foo2.equal = 5; assertEquals(1, dao.create(foo2)); QueryBuilder<Foo, Integer> qb = dao.queryBuilder(); qb.selectRaw("COUNT(*)"); GenericRawResults<String[]> rawResults = dao.queryRaw(qb.prepareStatementString()); List<String[]> results = rawResults.getResults(); assertEquals(1, results.size()); assertEquals("2", results.get(0)[0]); qb = dao.queryBuilder(); qb.selectRaw("MIN(val)", "MAX(val)"); rawResults = dao.queryRaw(qb.prepareStatementString()); results = rawResults.getResults(); assertEquals(1, results.size()); String[] result = results.get(0); assertEquals(2, result.length); assertEquals(Integer.toString(foo1.val), result[0]); assertEquals(Integer.toString(foo2.val), result[1]); }
@Test public void testHaving() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); Foo foo = new Foo(); int val1 = 243342; foo.val = val1; assertEquals(1, dao.create(foo)); foo = new Foo(); foo.val = val1; assertEquals(1, dao.create(foo)); foo = new Foo(); int val2 = 6543; foo.val = val2; assertEquals(1, dao.create(foo)); QueryBuilder<Foo, Integer> qb = dao.queryBuilder(); qb.selectColumns(Foo.VAL_COLUMN_NAME); qb.groupBy(Foo.VAL_COLUMN_NAME); qb.having("COUNT(VAL) > 1"); GenericRawResults<String[]> results = dao.queryRaw(qb.prepareStatementString()); List<String[]> list = results.getResults(); assertEquals(1, list.size()); assertEquals(String.valueOf(val1), list.get(0)[0]); qb.having("COUNT(VAL) > 2"); results = dao.queryRaw(qb.prepareStatementString()); list = results.getResults(); assertEquals(0, list.size()); }