junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/client/Cookies.java
public static Cookie cookie(String name, String value, String domain, String path, Long expires, Long maxAge, boolean secure, boolean httpOnly) {
		Cookie.Builder builder = new Cookie.Builder(name, value)
			.domain(domain)
			.path(path)
			.secure(secure)
			.httpOnly(httpOnly);

		if (expires != null) {
			builder.expires(expires);
		}

		if (maxAge != null) {
			builder.maxAge(maxAge);
		}

		return builder.build();
	}
public static Cookie cookie(String name, String value, String domain, String path, Long expires, Long maxAge, boolean secure, boolean httpOnly) {
		Cookie.Builder builder = new Cookie.Builder(name, value)
			.domain(domain)
			.path(path)
			.secure(secure)
			.httpOnly(httpOnly);

		if (expires != null) {
			builder.expires(expires);
		}

		if (maxAge != null) {
			builder.maxAge(maxAge);
		}

		return builder.build();
	}
Create cookie.

@param name Cookie name.
@param value Cookie value.
@param domain Cookie domain.
@param path Cookie path.
@param expires Cookie expires value.
@param maxAge Cookie max age value.
@param secure Secure flag.
@param httpOnly Http flag.
@return Cookie.
@throws NullPointerException if name or value is null.
@throws IllegalArgumentException if name is empty or blank.