@Test
    void verifyOtherSetCookieHeaderIsNotDiscarded() {
        val context = getCookieGenerationContext();
        val cookieValueManager = new NoOpCookieValueManager(tenantExtractor);

        val gen = CookieUtils.buildCookieRetrievingGenerator(cookieValueManager, context);
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        response.addHeader("Set-Cookie", gen.getCookieName() + "=some-cookie-value");
        response.addHeader("Set-Cookie", "OtherCookie=other-cookie-value");
        var headers = response.getHeaders("Set-Cookie");
        assertEquals(2, headers.size());
        val cookie = gen.addCookie(request, response, "some-value");
        assertNotNull(cookie);
        assertEquals("some-value", cookie.getValue());
        var headersAfter = response.getHeaders("Set-Cookie");
        assertEquals(2, headersAfter.size());
        val headerValuesAfter = response.getHeaderValues("Set-Cookie").stream()
            .map(String.class::cast)
            .map(header -> Arrays.stream(header.split(";")).iterator().next())
            .collect(Collectors.toSet());
        assertEquals(headerValuesAfter, CollectionUtils.wrapSet(cookie.getName() + "=some-value", "OtherCookie=other-cookie-value"));
    }
This is {@link CookieRetrievingCookieGeneratorTests}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-cookie/src/test/java/org/apereo/cas/web/support/CookieRetrievingCookieGeneratorTests.java