ContextualStatementBuilder setCookie = (cookieParam instanceof Parameter) ?
Stmt.loadVariable(((Parameter) cookieParam).getName()) :
Stmt.nestedCall(cookieParam);
setCookie.if_(BooleanOperator.NotEquals, null)
.append(Stmt.invokeStatic(RestClient.class, "setCookie", cookieName, marshal(cookieParam)))
.finish();
block.addStatement(setCookie);
}