FieldLogParam implements LogParam { @Override public void append(StringBuilder builder, Set<String> maskedFields, int maxParamLength) { if (maskedFields.contains(field)) { builder.append("******"); } else { builder.append(value); } } FieldLogParam(String field, String value); @Override void append(StringBuilder builder, Set<String> maskedFields, int maxParamLength);  }
@Test void append() { var param = new FieldLogParam("SessionId", "value"); var builder = new StringBuilder(); param.append(builder, Set.of("SessionId"), 1000); assertThat(builder.toString()).isNotEqualTo("value"); builder = new StringBuilder(); param.append(builder, Set.of(), 1000); assertThat(builder.toString()).isEqualTo("value"); }