public static CookieBuilder newCookieBuilder(HttpRequest request) {
    return new CookieBuilder(request);
  }
@Test
  public void create_secured_cookie_when_X_Forwarded_Proto_header_is_https() {
    when(request.getHeader(HTTPS_HEADER)).thenReturn("https");
    Cookie cookie = newCookieBuilder(request).setName("name").setValue("value").setHttpOnly(true).setExpiry(10).build();
    assertThat(cookie.isSecure()).isTrue();
  }