### Question:
QueryImpl implements Query, com.impetus.kundera.query.Query { protected String[] getColumns(final String[] columns, final EntityMetadata m) { List<String> columnAsList = new ArrayList<String>(); if (columns != null && columns.length > 0) { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( m.getPersistenceUnit()); EntityType entity = metaModel.entity(m.getEntityClazz()); for (int i = 1; i < columns.length; i++) { if (columns[i] != null) { Attribute col = entity.getAttribute(columns[i]); if (col == null) { throw new QueryHandlerException("column type is null for: " + columns); } columnAsList.add(((AbstractAttribute) col).getJPAColumnName()); } } } return columnAsList.toArray(new String[] {}); } QueryImpl(KunderaQuery kunderaQuery, PersistenceDelegator persistenceDelegator,
            final KunderaMetadata kunderaMetadata); String getJPAQuery(); KunderaQuery getKunderaQuery(); @Override int executeUpdate(); @Override List<?> getResultList(); @Override Object getSingleResult(); @Override Query setFirstResult(int startPosition); @Override Query setFlushMode(FlushModeType flushMode); @Override Query setHint(String hintName, Object value); @Override Query setMaxResults(int maxResult); @Override Query setParameter(String name, Object value); @Override Query setParameter(int position, Object value); @Override Query setParameter(String name, Date value, TemporalType temporalType); @Override Query setParameter(String name, Calendar value, TemporalType temporalType); @Override Query setParameter(int position, Date value, TemporalType temporalType); @Override Query setParameter(int position, Calendar value, TemporalType temporalType); @Override int getMaxResults(); @Override int getFirstResult(); @Override Map<String, Object> getHints(); @Override Query setParameter(Parameter<T> paramParameter, T paramT); @Override Query setParameter(Parameter<Calendar> paramParameter, Calendar paramCalendar, TemporalType paramTemporalType); @Override Query setParameter(Parameter<Date> paramParameter, Date paramDate, TemporalType paramTemporalType); @Override Set<Parameter<?>> getParameters(); @Override Parameter<?> getParameter(String paramString); @Override Parameter<T> getParameter(String paramString, Class<T> paramClass); @Override Parameter<?> getParameter(int paramInt); @Override Parameter<T> getParameter(int paramInt, Class<T> paramClass); @Override boolean isBound(Parameter<?> paramParameter); @Override T getParameterValue(Parameter<T> paramParameter); @Override Object getParameterValue(String paramString); @Override Object getParameterValue(int paramInt); @Override FlushModeType getFlushMode(); @Override Query setLockMode(LockModeType paramLockModeType); @Override LockModeType getLockMode(); @Override T unwrap(Class<T> paramClass); void setFetchSize(Integer fetchsize); Integer getFetchSize(); void applyTTL(int ttlInSeconds); abstract void close(); abstract Iterator<E> iterate();  }### Answer:
@Test public void testGetColumns() { try { String queryStr = "Select p from Person p where p.personId = :personId"; PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em); KunderaQueryParser queryParser; KunderaQuery kunderaQuery = parseQuery(queryStr); CoreQuery query = new CoreQuery(kunderaQuery, delegator, kunderaMetadata); EntityMetadata m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, Person.class); String[] columns = query.getColumns(new String[] { "personName", "age" }, m); Assert.assertNotNull(columns); Assert.assertTrue(columns.length > 0); } catch (SecurityException e) { Assert.fail(e.getMessage()); } catch (IllegalArgumentException e) { Assert.fail(e.getMessage()); } catch (NoSuchFieldException e) { Assert.fail(e.getMessage()); } catch (IllegalAccessException e) { Assert.fail(e.getMessage()); } }