public static String reformatParam(@Nullable Object param) {
    if (param == null) {
      return PARAM_NULL;
    }
    String abbreviated = abbreviate(param.toString(), PARAM_MAX_WIDTH);
    return NEWLINE_PATTERN.matcher(abbreviated).replaceAll("\\\\n");
  }
@Test
  public void reformatParam_truncates_if_too_long() {
    String param = repeat("a", SqlLogFormatter.PARAM_MAX_WIDTH + 10);
    String formattedParam = SqlLogFormatter.reformatParam(param);
    assertThat(formattedParam)
      .hasSize(SqlLogFormatter.PARAM_MAX_WIDTH)
      .endsWith("...")
      .startsWith(repeat("a", SqlLogFormatter.PARAM_MAX_WIDTH - 3));
  }