### Question:
BaseDaoESImp implements BaseDao { protected void append(BoolQueryBuilder boolQueryBuilder, List<String> list, String field) { appendBase(boolQueryBuilder, list, null, field); } BaseDaoESImp();  BaseDaoESImp(Properties properties); static String getResourceAbsolutePath(String resourcePath); static String genericScriptReader(Path path); void setESClient(ESClient esclient); @Override BoolQueryBuilder createQueryForMultiValue(TargetingChannel targetingChannel); @Override BoolQueryBuilder createQueryForMultiValuePlusAgeGender(TargetingChannel targetingChannel); @Override BoolQueryBuilder createQueryForAgeGender(TargetingChannel targetingChannel); @Override Map<Double, BoolQueryBuilder> createQueryForSingleValuesWithRegionRatio(TargetingChannel targetingChannel); @Override BoolQueryBuilder createQueryForSingleValues(TargetingChannel targetingChannel); @Override BoolQueryBuilder createOrQueryForSingleValue(List<TargetingChannel> tcs); @Override BoolQueryBuilder createInvQueryForSingleValue(TargetingChannel targetingChannel); @Override BoolQueryBuilder createInvQuery(BoolQueryBuilder boolQueryBuilder); @Override BoolQueryBuilder createAndQueryForSingleValue(List<TargetingChannel> tcs); @Override BoolQueryBuilder createAndQueryForMultiValuePlusAgeGender(List<TargetingChannel> tcs); @Override BoolQueryBuilder createAndQueryForAgeGender(List<TargetingChannel> tcs); static final String ES_TYPE; static final String ES_PREDICTION_DOC_PREFIX; static final String ES_TBR_DOC_PREFIX; static final String ES_CHART_DOC_PREFIX; }### Answer:
@Test public void append() { BoolQueryBuilder bqBldr = new BoolQueryBuilder(); List<String> list = new ArrayList(); String field = "field"; BaseDaoESImp bd = new BaseDaoESImp(); bd.append(bqBldr, list, field); bd.append(bqBldr, list, new ArrayList(), field); bd.append(bqBldr, field, "value"); String exp = "{\n" + " \"bool\" : {\n" + " \"must\" : [\n" + " {\n" + " \"match_phrase\" : {\n" + " \"field\" : {\n" + " \"query\" : \"value\",\n" + " \"slop\" : 0,\n" + " \"zero_terms_query\" : \"NONE\",\n" + " \"boost\" : 1.0\n" + " }\n" + " }\n" + " }\n" + " ],\n" + " \"adjust_pure_negative\" : true,\n" + " \"boost\" : 1.0\n" + " }\n" + "}"; assertTrue(exp.equals(bqBldr.toString())); }