### Question:
LuceneToJexlControlledQueryParser extends LuceneToJexlQueryParser implements ControlledQueryParser { @Override public void setIncludedValues(Map<String,Set<String>> includedValues) { this.includedValues = includedValues; } LuceneToJexlControlledQueryParser(); @Override QueryNode parse(String query); @Override void setExcludedValues(Map<String,Set<String>> excludedValues); @Override Map<String,Set<String>> getExcludedValues(); @Override void setIncludedValues(Map<String,Set<String>> includedValues); @Override Map<String,Set<String>> getIncludedValues();  }### Answer:
@Test public void testAllowedAnyfieldWithEmptyAllowedFields() throws ParseException { parser = new LuceneToJexlControlledQueryParser(); parser.setAllowAnyField(true); parser.setIncludedValues(ImmutableMap.<String,Set<String>> of()); parser.setAllowedFields(ImmutableSet.<String> of()); parseQuery("unfieldedValue"); }
@Test public void testIncludedFields() throws ParseException { parser = new LuceneToJexlControlledQueryParser(); Set<String> allowedFields = new HashSet<>(); allowedFields.add("FIELD1"); allowedFields.add("FIELD2"); allowedFields.add("FIELD3"); parser.setAllowedFields(allowedFields); Map<String,Set<String>> includedValues = new LinkedHashMap<>(); includedValues.put("FIELD2", Collections.singleton("specialvalue2")); includedValues.put("FIELD3", Collections.singleton("specialvalue3")); parser.setIncludedValues(includedValues); Assert.assertEquals("(FIELD1 == 'value') && ((filter:includeRegex(FIELD2, 'specialvalue2')) || (filter:includeRegex(FIELD3, 'specialvalue3')))", parseQuery("FIELD1:value")); }