### Question:
BaseDaoESImp implements BaseDao { @Override public BoolQueryBuilder createAndQueryForMultiValuePlusAgeGender(List<TargetingChannel> tcs) { BoolQueryBuilder boolQueryBuilder = null; for (TargetingChannel tc : tcs) { if (boolQueryBuilder == null) { boolQueryBuilder = createQueryForMultiValuePlusAgeGender(tc); } else { BoolQueryBuilder boolQueryBuilder1 = createQueryForMultiValuePlusAgeGender(tc); boolQueryBuilder.must(boolQueryBuilder1); } } return boolQueryBuilder; } 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 createAndQueryForMultiValuePlusAgeGender() { BaseDaoESImp bd = new BaseDaoESImp(); TargetingChannel tc = new TargetingChannel(); List<TargetingChannel> list = new ArrayList(); list.add(tc); TargetingChannel tc2 = new TargetingChannel(); tc2.setG(Arrays.asList("G")); list.add(tc2); BoolQueryBuilder res = bd.createAndQueryForMultiValuePlusAgeGender(list); String exp = "{\"bool\":{\"must\":[{\"bool\":{\"must\":[{\"bool\":{\"should\":[{\"match_phrase\":{\"data.g\":{\"query\":\"G\",\"slop\":0,\"zero_terms_query\":\"NONE\",\"boost\":1.0}}}]," + "\"adjust_pure_negative\":true,\"boost\":1.0}}],\"adjust_pure_negative\":true,\"boost\":1.0}}],\"adjust_pure_negative\":true,\"boost\":1.0}}"; assertEquals(exp, res.toString().replaceAll("\\s+", "")); }