MinusculeMatcher (String searchString, boolean preferStartMatches) { NameUtil.MatcherBuilder builder = NameUtil.buildMatcher("*" + searchString); if (preferStartMatches) { builder = builder.preferringStartMatches(); } return builder.build(); }