NameAndCountFieldValuesFilter implements FieldValuesFilter, Serializable { private boolean matchesName(String value) { return namePattern.matcher(value).find(); }  String getName(); void setName(String name); Integer getMinimalOccurence(); void setMinimalOccurence(Integer minimalOccurence); Character getFirstCharacter(); void setFirstCharacter(Character firstCharacter); @Override boolean matches(Count count, IConverter<String> converter); @Override boolean isEmpty(); @Override NameAndCountFieldValuesFilter copy(); static final char ANY_CHARACTER_SYMBOL; static final char NON_ALPHABETICAL_CHARACTER_SYMBOL; }
@Test public void testMatchesName() { assertTrue(filter.matches(count, null)); filter.setName(null); assertTrue(filter.matches(count, null)); filter.setName("v"); assertTrue("Partial left match", filter.matches(count, null)); filter.setName("val"); assertTrue("Partial left match", filter.matches(count, null)); filter.setName("value"); assertTrue("Complete match", filter.matches(count, null)); filter.setName("alue"); assertTrue("Partial middle match", filter.matches(count, null)); filter.setName("values"); assertFalse("Complete match", filter.matches(count, null)); }