SystemPropertiesERDC implements ErrorReportDataCollector { void fillValues(Map<String, String> map, Properties properties) { for (Object keyObject : properties.keySet()) { String key = keyObject.toString(); String property = properties.getProperty(key); if (!key.toLowerCase().matches(".*(user\\.|password).*")) { map.put(PREFIX + key, property); } } }  @Override Map<String, String> collect(ErrorReportCollectingContext context);  }
@Test public void testFillValues() { Properties p = new Properties(); p.setProperty("a","b"); p.setProperty("c","d"); HashMap<String, String> map = new HashMap<>(); erdc.fillValues(map, p); assertEquals(map.get(PREFIX+"a"), "b"); assertEquals(map.get(PREFIX+"c"), "d"); }