### Question:
SensitiveDataConverter extends MessageConverter { private String passwordHandler(Pattern pwdPattern, String logMsg) { Matcher matcher = pwdPattern.matcher(logMsg); StringBuffer sb = new StringBuffer(logMsg.length()); while (matcher.find()) { String password = matcher.group(); String maskPassword = SensitiveLogUtils.maskDataSourcePwd(password); matcher.appendReplacement(sb, maskPassword); } matcher.appendTail(sb); return sb.toString(); }  @Override String convert(ILoggingEvent event);  }### Answer:
@Test public void testPwdLogMsgConverter() { logger.info("parameter : {}", logMsg); logger.info("parameter : {}", passwordHandler(pwdPattern, logMsg)); Assert.assertNotEquals(logMsg, passwordHandler(pwdPattern, logMsg)); Assert.assertEquals(maskLogMsg, passwordHandler(pwdPattern, logMsg)); }