}
// set cookies based on @CookieParams
if (params.getCookieParameters() != null) {
for (String cookieName : params.getCookieParameters().keySet()) {
Parameter cookieParam = params.getCookieParameters().get(cookieName).get(0);
Statement setCookie = Stmt.loadVariable(cookieParam.getName())
.if_(BooleanOperator.NotEquals, null)
.append(Stmt.invokeStatic(Cookies.class, "setCookie", cookieName, marshal(cookieParam)))
.finish();
methodBlock.append(setCookie);