### Question:
PostRedirectGetWithCookiesFormHelperImpl extends PostRedirectGetFormHelperImpl implements PostRedirectGetWithCookiesFormHelper { @Override protected final String decode(String encoded) { try { return StringUtils.isBlank(encoded) ? "" : URLDecoder.decode(encoded, "UTF-8"); } catch (UnsupportedEncodingException ex) { log.error("Cannot decode '{}'", ex); return encoded; } }  @Override final void sendRedirect(Form form, String path, String formSelector, SlingHttpServletResponse response); @Override final void sendRedirect(Form form, Page page, String formSelector, SlingHttpServletResponse response); @Override final void sendRedirect(Form form, Resource resource, String formSelector,
            SlingHttpServletResponse response); static final int COOKIE_MAX_AGE; static final String ROOT_COOKIE_PATH; }### Answer:
@Test public void shouldSerialiseFormInRedirectUrlParameter() throws Exception { request.setMethod("POST"); request.setParameterMap(ImmutableMap.<String, Object>of(":form", "x", "hello", "world")); final SlingHttpServletResponse spiedResponse = spy(response); final Form form = formHelper.getForm("x", request, response); form.setError("hello", "Error1"); formHelper.renderForm(form, requestResource, request, spiedResponse); verify(spiedResponse).addCookie(cookieCaptor.capture()); final Cookie formCookie = cookieCaptor.getValue(); final String formString = decode(formCookie.getValue()); final JSONObject formObject = toJSONObject(formString); assertThat(formObject.getString(PostRedirectGetFormHelperImpl.KEY_FORM_NAME), is(equalTo("x"))); final JSONObject formErrors = formObject.getJSONObject(PostRedirectGetFormHelperImpl.KEY_ERRORS); assertThat(formErrors.getString("hello"), is(equalTo("Error1"))); final JSONObject formData = formObject.getJSONObject(PostRedirectGetFormHelperImpl.KEY_FORM); assertThat(formData.getString("hello"), is(equalTo("world"))); }