### Question:
LuceneToJexlControlledQueryParser extends LuceneToJexlQueryParser implements ControlledQueryParser { @Override public QueryNode parse(String query) throws ParseException { StringBuilder sb = new StringBuilder(); boolean addedFirstInclude = false; for (Map.Entry<String,Set<String>> entry : includedValues.entrySet()) { String field = entry.getKey(); for (String value : entry.getValue()) { if (addedFirstInclude == true) { sb.append(" OR "); } addedFirstInclude = true; sb.append("#INCLUDE(").append(field).append(", ").append(value).append(")"); } } if (!includedValues.isEmpty() && !excludedValues.isEmpty()) { sb.append(" AND "); } boolean addedFirstExclude = false; for (Map.Entry<String,Set<String>> entry : excludedValues.entrySet()) { String field = entry.getKey(); for (String value : entry.getValue()) { if (addedFirstExclude == true) { sb.append(" AND "); } addedFirstExclude = true; sb.append("#EXCLUDE(").append(field).append(", ").append(value).append(")"); } } if (sb.length() > 0) { query = "(" + query + ")" + " AND (" + sb + ")"; } return super.parse(query); } 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 testTransformsLowerCaseBeforeComparingAgainstAllowed() throws ParseException { parser = new LuceneToJexlControlledQueryParser(); Set<String> allowedFields = new HashSet<>(); allowedFields.add("FIELD1"); allowedFields.add("FIELD2"); allowedFields.add("FIELD3"); parser.setAllowedFields(allowedFields); parser.parse("FIELD1:value field2:value FIELD3:value"); parser.parse("field1:value FIELD2:value field3:value"); }