### Question:
DataUtils { public static <E> E handleDataWithSecret(E data) { E dataForLog = data; if(data instanceof String && StringUtils.contains((String)data, "&secret=")){ dataForLog = (E) StringUtils.replaceAll((String)data,"&secret=\\w+&","&secret=******&"); } return dataForLog; }  static E handleDataWithSecret(E data);  }### Answer:
@Test public void testHandleDataWithSecret() { String data = "js_code=001tZveq0SMoiq1AEXeq0ECJeq0tZveZ&secret=5681022fa1643845392367ea88888888&grant_type=authorization_code&appid=wxe156d4848d999999"; final String s = DataUtils.handleDataWithSecret(data); assertThat(s).contains("&secret=******&"); }
@Test public void testHandleDataWithSecret() { String data = "js_code=001tZveq0SMoiq1AEXeq0ECJeq0tZveZ&secret=5681022fa1643845392367ea88888888&grant_type=authorization_code&appid=wxe156d4848d999999"; final String s = DataUtils.handleDataWithSecret(data); assertTrue(s.contains("&secret=******&")); }