### Question:
DB { @SuppressWarnings("unchecked") public <T> T[] list(Class<T> type, String way, Object... parameters) { if (LOG.isInfoEnabled()) LOG.info("[list] listing all " + type.getName() + "(s) *" + way + "* using parameters: " + Arrays.toString(parameters) + " ..."); long start = System.currentTimeMillis(); String sql = loadSql(type, way); if (LOG.isDebugEnabled()) LOG.debug("[list] ... executing SQL '" + sql + "' ..."); List<T> list = jdbc.query(sql, parameters, new SimpleRowMapper<T>(type)); T[] array = list.toArray((T[]) Array.newInstance(type, list.size())); if (LOG.isInfoEnabled()) LOG.info("[list] ... returning " + array.length + " " + type.getName() + "(s) in " + (System.currentTimeMillis() - start) + "ms"); if (LOG.isDebugEnabled()) LOG.debug("[list] ... and they are: " + list); return array; } DB(DataSource dataSource); @SuppressWarnings("unchecked") T[] list(Class<T> type, String way, Object... parameters); T fetch(Class<T> type, String way, Object... parameters); void update(Class<T> type, String way, Object... parameters); void update(T object, String way, Object... parameters); void update(T[] objects, String way, Object... parameters);  }### Answer:
@Test public void return_array() { Dealer[] dealers = db.list(Dealer.class, "with-name-matching", "%penta%"); assertTrue(dealers.length > 0); }