### Question:
IndexQuery { public static StringPrefixPredicate stringPrefix( int propertyKeyId, TextValue prefix ) { return new StringPrefixPredicate( propertyKeyId, prefix ); } protected  IndexQuery( int propertyKeyId ); static ExistsPredicate exists( int propertyKeyId ); static ExactPredicate exact( int propertyKeyId, Object value ); static RangePredicate<?> range( int propertyKeyId,
                                        Number from, boolean fromInclusive,
                                        Number to, boolean toInclusive ); static RangePredicate<?> range( int propertyKeyId,
                                        String from, boolean fromInclusive,
                                        String to, boolean toInclusive ); static RangePredicate<?> range( int propertyKeyId,
                                                              VALUE from, boolean fromInclusive,
                                                              VALUE to, boolean toInclusive ); static RangePredicate<?> range( int propertyKeyId, ValueGroup valueGroup ); static RangePredicate<?> range( int propertyKeyId, CoordinateReferenceSystem crs ); static StringPrefixPredicate stringPrefix( int propertyKeyId, TextValue prefix ); static StringContainsPredicate stringContains( int propertyKeyId, TextValue contains ); static StringSuffixPredicate stringSuffix( int propertyKeyId, TextValue suffix ); static ValueTuple asValueTuple( IndexQuery.ExactPredicate... query ); abstract IndexQueryType type(); @SuppressWarnings( "EqualsWhichDoesntCheckParameterClass" ) @Override final boolean equals( Object other ); @Override final int hashCode(); @Override final String toString(); final int propertyKeyId(); abstract boolean acceptsValue( Value value ); boolean acceptsValueAt( PropertyCursor property ); abstract ValueGroup valueGroup();  }### Answer:
@Test public void testStringPrefix_FalseForIrrelevant() { StringPrefixPredicate p = IndexQuery.stringPrefix( propId, stringValue( "dog" ) ); assertFalseForOtherThings( p ); }
@Test public void testStringPrefix_SomeValues() { StringPrefixPredicate p = IndexQuery.stringPrefix( propId, stringValue( "dog" ) ); assertFalse( test( p, "doffington" ) ); assertFalse( test( p, "doh, not this again!" ) ); assertTrue( test( p, "dog" ) ); assertTrue( test( p, "doggidog" ) ); assertTrue( test( p, "doggidogdog" ) ); }