### Question:
SelectQueryBuilder { public String build() { Validate.notNull(databaseName, "tableName can not be null."); Validate.notNull(tableName, "tableName can not be null."); Validate.notNull(projection, "projection can not be null."); Validate.notEmpty(projection, "projection can not be empty."); query.add(TEMPLATE_FIELD, this); return query.render().trim(); } SelectQueryBuilder(ST template, String viewTextPropertyName); List<String> getProjection(); SelectQueryBuilder withProjection(Schema schema); String getViewText(); List<String> getConjucts(); SelectQueryBuilder withConjucts(Constraints constraints); String getTableName(); SelectQueryBuilder withTableName(String tableName); String getDatabaseName(); SelectQueryBuilder withDatabaseName(String databaseName); String build();  }### Answer:
@Test public void build() { logger.info("build: enter"); String expected = "SELECT col1, col2, col3, col4 FROM \"myDatabase\".\"myTable\" WHERE (\"col4\" IN ('val1','val2')) AND ((\"col2\" < 1)) AND (\"col3\" IN (20000,10000)) AND ((\"col1\" > 1))"; Map<String, ValueSet> constraintsMap = new HashMap<>(); constraintsMap.put("col1", SortedRangeSet.copyOf(Types.MinorType.INT.getType(), ImmutableList.of(Range.greaterThan(allocator, Types.MinorType.INT.getType(), 1)), false)); constraintsMap.put("col2", SortedRangeSet.copyOf(Types.MinorType.INT.getType(), ImmutableList.of(Range.lessThan(allocator, Types.MinorType.INT.getType(), 1)), false)); constraintsMap.put("col3", EquatableValueSet.newBuilder(allocator, Types.MinorType.INT.getType(), true, true) .add(20000L) .add(10000L) .build()); constraintsMap.put("col4", EquatableValueSet.newBuilder(allocator, Types.MinorType.VARCHAR.getType(), true, true) .add("val1") .add("val2") .build()); Schema schema = SchemaBuilder.newBuilder() .addStringField("col1") .addIntField("col2") .addBigIntField("col3") .addStringField("col4") .build(); String actual = queryFactory.createSelectQueryBuilder(VIEW_METADATA_FIELD) .withDatabaseName("myDatabase") .withTableName("myTable") .withProjection(schema) .withConjucts(new Constraints(constraintsMap)) .build().replace("\n", ""); logger.info("build: actual[{}]", actual); assertEquals(expected, actual); logger.info("build: exit"); }