StringStartsWith extends SimpleQuery<O, A> { public StringStartsWith(Attribute<O, A> attribute, A value) { super(attribute); this.value = checkQueryValueNotNull(value); } StringStartsWith(Attribute<O, A> attribute, A value); A getValue(); @SuppressWarnings("unused") static boolean matchesValue(CharSequence aValue, CharSequence bValue, QueryOptions queryOptions); @Override boolean equals(Object o); @Override String toString();  }
@Test public void testStringStartsWith() { Attribute<String, String> stringIdentity = new SelfAttribute<String>(String.class, "identity"); assertTrue(startsWith(stringIdentity, "THIS").matches("THIS IS A TEST", noQueryOptions())); assertFalse(startsWith(stringIdentity, "TEST").matches("THIS IS A TEST", noQueryOptions())); assertFalse(startsWith(stringIdentity, "HIS").matches("THIS IS A TEST", noQueryOptions())); assertTrue(startsWith(stringIdentity, "").matches("THIS IS A TEST", noQueryOptions())); assertTrue(startsWith(stringIdentity, "").matches("", noQueryOptions())); assertFalse(startsWith(stringIdentity, "TEST").matches("", noQueryOptions())); }