String (@NotNull ParametersList vmParameters, @NotNull String value) { Matcher matcher = PROPERTY_PATTERN.matcher(value); Map<String, String> toReplace = new HashMap<>(); while (matcher.find()) { String finding = matcher.group(); final String propertyValue = vmParameters.getPropertyValue(finding.substring(2, finding.length() - 1)); if(propertyValue == null) continue; toReplace.put(finding, propertyValue); } for (Map.Entry<String, String> entry : toReplace.entrySet()) { value = value.replace(entry.getKey(), entry.getValue()); } return value; }