private static boolean containsCookie(@NotNull HttpClient client, @NotNull String cookieName) {
    for (Cookie cookie : client.getState().getCookies()) {
      if (cookie.getName().equals(cookieName) && !cookie.isExpired()) {
        return true;
      }
    }
    return false;
  }
private static boolean containsCookie(@NotNull HttpClient client, @NotNull String cookieName)