public void refreshState(HttpRequest request, HttpResponse response, String csrfState, int timeoutInSeconds) {
    response.addHeader(SET_COOKIE,
      newCookieBuilder(request)
        .setName(CSRF_STATE_COOKIE)
        .setValue(csrfState)
        .setHttpOnly(false)
        .setExpiry(timeoutInSeconds)
        .setSameSite(SAMESITE_LAX)
        .toValueString());
  }
@Test
  public void refresh_state() {
    underTest.refreshState(request, response, CSRF_STATE, 30);

    verify(response).addHeader(SET_COOKIE, String.format("XSRF-TOKEN=%s; Path=/; SameSite=Lax; Max-Age=30", CSRF_STATE));
  }