### Question:
BaseDaoESImp implements BaseDao { @Override public BoolQueryBuilder createInvQuery(BoolQueryBuilder boolQueryBuilder) { BoolQueryBuilder result = new BoolQueryBuilder(); result.must(QueryBuilders.matchAllQuery()); result.mustNot(boolQueryBuilder); return result; } 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 createInvQuery() { BaseDaoESImp bd = new BaseDaoESImp(); BoolQueryBuilder bqBldr = new BoolQueryBuilder(); BoolQueryBuilder res = bd.createInvQuery(bqBldr); String exp = "{\"bool\":{\"must\":[{\"match_all\":{\"boost\":1.0}}],\"must_not\":[{\"bool\":{\"adjust_pure_negative\":true,\"boost\":1.0}}],\"adjust_pure_negative\":true,\"boost\":1.0}}"; assertEquals(exp, res.toString().replaceAll("\\s+", "")); }