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 resolveEnvVar() throws Exception {
        SystemLambda.withEnvironmentVariable("VARNAME", "varvalue").execute(() -> {
            String resolved = EnvVarResolverProperties.resolveEnvVars("padding ${VARNAME} padding");
            assertEquals(resolved, "padding varvalue padding");
        });
    }