### Question:
SQLQueryBuilder { public String buildSelectQuery() { StringBuilder sb = new StringBuilder("SELECT ") .append(buildColumnsQuery()) .append(" FROM ") .append(getSource()); buildWhereSQL(sb); buildFragmenterSql(context, dbProduct, quoteString, sb); return sb.toString(); } SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData);  SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery); String buildSelectQuery(); String buildInsertQuery(); void autoSetQuoteString(); void forceSetQuoteString(); void buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query);  }### Answer:
@Test public void testColumnProjection() throws Exception { context.setFilterString("a0c20s1d1o5"); context.getTupleDescription().get(1).setProjected(false); context.getTupleDescription().get(3).setProjected(false); context.getTupleDescription().get(4).setProjected(false); SQLQueryBuilder builder = new SQLQueryBuilder(context, mockMetaData); String query = builder.buildSelectQuery(); assertEquals("SELECT id, amt FROM sales WHERE id = 1", query); }
@Test public void testSimpleNamedQuery() throws Exception { SQLQueryBuilder builder = new SQLQueryBuilder(context, mockMetaData, NAMED_QUERY_WHERE); String query = builder.buildSelectQuery(); assertEquals("SELECT id, cdate, amt, grade, b FROM (SELECT a, b FROM c WHERE d = 'foo') pxfsubquery", query); }
@Test public void testNamedQueryColumnProjection() throws Exception { context.setFilterString("a0c20s1d1o5"); context.getTupleDescription().get(1).setProjected(false); context.getTupleDescription().get(3).setProjected(false); context.getTupleDescription().get(4).setProjected(false); SQLQueryBuilder builder = new SQLQueryBuilder(context, mockMetaData, NAMED_QUERY_WHERE); String query = builder.buildSelectQuery(); assertEquals("SELECT id, amt FROM (SELECT a, b FROM c WHERE d = 'foo') pxfsubquery WHERE id = 1", query); }