### Question:
QueryBuilder implements Closeable { public String getBatchedQuery(int batch) { if (!hasBatch) { if (batch==0) { getQuery(); } else { return null; } } StringBuilder query = new StringBuilder(prefix); boolean needsWhere = !whereAdded; for (QueryClause clause : clauses) { if (needsWhere) { query.append(" WHERE "); needsWhere=false; } else { query.append(" AND "); } if (clause.isBatched()) { String batchClause = clause.getClauseForBatch(batch); if (batchClause==null) { return null; } query.append(batchClause); } else { query.append(clause.getClause()); } } if (suffix!=null) { query.append(" ").append(suffix); } return query.toString(); } QueryBuilder(JdbcFactory factory, String prefix);  QueryBuilder(JdbcFactory factory, String prefix, boolean whereAdded); void setSuffix(String suffix); @Override String toString(); String getBatchedQuery(int batch); String getQuery(); boolean isEmpty(); List<QueryClause> getClauses(); void addInClause(String field, Collection<?> values, int sqlType); void addBatchedInClause(String field, List<?> values, int sqlType); void addInLikeClause(String field, Collection<String> values, boolean useInIfPossible); void addNotInClause(String field, Collection<?> values, int sqlType); void addClause(String clause, Object value, int sqlType); void addClause(String clause, Object value); void addFieldClause(String fieldName, Object value, int sqlType); void addFieldClause(String fieldName, Object value); void addNoParamClause(String clause); void addClause(QueryClause clause); void addClauses(Collection<QueryClause> clauses); ResultSet execute(); Map<K,V> execute(ResultMapper<K,V> processor); void execute(ResultMapper<K,V> processor, Map<K,V> results); List<T> execute(ResultProcessor<T> processor); void execute(ResultProcessor<T> processor, Collection<T> results); @Override void close();  }### Answer:
@Test public void testGetBatchedQuery() throws Exception { System.out.println("getBatchedQuery"); List<?> values = Arrays.asList(1,2,3,4,5,6,7); QueryBuilder builder = new QueryBuilder(jdbc,SELECT_PREFIX,false); builder.addClause(QueryClause.createBatchedInClause("id", values, Types.INTEGER, 5)); String expected = SELECT_PREFIX+" WHERE id IN (?,?,?,?,?)"; assertEquals(builder.getBatchedQuery(0), expected); expected = SELECT_PREFIX+" WHERE id IN (?,?)"; assertEquals(builder.getBatchedQuery(1), expected); }