class SystemProperties {

    public static Map<String, String> maskSystemProperties(Map<String, String> systemProperties,
            List<String> maskSystemProperties) {
        if (maskSystemProperties.isEmpty()) {
            return systemProperties;
        }
        List<Pattern> maskPatterns = buildPatternList(maskSystemProperties);
        Map<String, String> maskedSystemProperties = Maps.newHashMap();
        for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
            String name = entry.getKey();
            if (matchesAny(name, maskPatterns)) {
                maskedSystemProperties.put(name, "****");
            } else {
                maskedSystemProperties.put(name, entry.getValue());
            }
        }
        return maskedSystemProperties;
    }

    private  SystemProperties();

}