### Question:
LuceneDocumentStructure { public static Query newRangeSeekByStringQuery( String lower, boolean includeLower, String upper, boolean includeUpper ) { boolean includeLowerBoundary = StringUtils.EMPTY.equals( lower ) || includeLower; boolean includeUpperBoundary = StringUtils.EMPTY.equals( upper ) || includeUpper; TermRangeQuery termRangeQuery = TermRangeQuery.newStringRange( ValueEncoding.String.key( 0 ), lower, upper, includeLowerBoundary, includeUpperBoundary ); if ( (includeLowerBoundary != includeLower) || (includeUpperBoundary != includeUpper) ) { BooleanQuery.Builder builder = new BooleanQuery.Builder(); builder.setDisableCoord(true); if ( includeLowerBoundary != includeLower ) { builder.add( new TermQuery( new Term( ValueEncoding.String.key( 0 ), lower ) ), BooleanClause.Occur.MUST_NOT ); } if ( includeUpperBoundary != includeUpper ) { builder.add( new TermQuery( new Term( ValueEncoding.String.key( 0 ), upper ) ), BooleanClause.Occur.MUST_NOT ); } builder.add( termRangeQuery, BooleanClause.Occur.FILTER ); return new ConstantScoreQuery( builder.build() ); } return termRangeQuery; } private  LuceneDocumentStructure(); static Document documentRepresentingProperties( long nodeId, Value... values ); static String encodedStringValuesForSampling( Value... values ); static MatchAllDocsQuery newScanQuery(); static Query newSeekQuery( Value... values ); static NumericRangeQuery<Double> newInclusiveNumericRangeSeekQuery( Number lower, Number upper ); static Query newRangeSeekByStringQuery( String lower, boolean includeLower,
            String upper, boolean includeUpper ); static Query newWildCardStringQuery( String searchFor ); static Query newRangeSeekByPrefixQuery( String prefix ); static Query newSuffixStringQuery( String suffix ); static Term newTermForChangeOrRemove( long nodeId ); static long getNodeId( Document from ); static TermsEnum originalTerms( Terms terms, String fieldKey ); static Field encodeValueField( Value value ); static boolean useFieldForUniquenessVerification( String fieldName ); static final String NODE_ID_KEY; static final String DELIMITER; }### Answer:
@Test void shouldBuildRangeSeekByStringQueryForStrings() { TermRangeQuery query = (TermRangeQuery) LuceneDocumentStructure .newRangeSeekByStringQuery( "foo", false, null, true ); assertEquals( "string", query.getField() ); assertEquals( "foo", query.getLowerTerm().utf8ToString() ); assertFalse( query.includesLower() ); assertNull( query.getUpperTerm() ); assertTrue( query.includesUpper() ); }