String (@NotNull ChooseByNameViewModel base, @NotNull String pattern) { String trimmedPattern; if (base.isSearchInAnyPlace() && !(trimmedPattern = pattern.trim()).isEmpty() && trimmedPattern.length() > 1) { pattern = "*" + pattern; } return pattern; }