protected static String resolveEnvVars(String input) {
        Preconditions.checkNotNull(input);
        // match ${ENV_VAR_NAME}
        Pattern p = Pattern.compile("\\$\\{(\\w+)\\}");
        Matcher m = p.matcher(input);
        StringBuffer sb = new StringBuffer();
        while (m.find()) {
            String envVarName = m.group(1);
            String envVarValue = System.getenv(envVarName);
            m.appendReplacement(sb, null == envVarValue ? "" : envVarValue);
        }
        m.appendTail(sb);
        return sb.toString();
    }
@Test
    public void resolveEnvVars() throws Exception {
        SystemLambda.withEnvironmentVariable("VARNAME1", "varvalue1")
                .and("VARNAME2", "varvalue2")
                .execute(() -> {
                    String resolved = EnvVarResolverProperties.resolveEnvVars(
                            "padding ${VARNAME1} ${VARNAME2} padding");
                    assertEquals(resolved, "padding varvalue1 varvalue2 padding");
                });
    }