@Override
    public void process(HttpResponse response, HttpContext context) throws
            HttpException, IOException {
        List<Header> warnings = Arrays.stream(response.getHeaders("Warning")).filter(header -> !this.isDeprecationMessage(header.getValue())).collect(Collectors.toList());
        response.removeHeaders("Warning");
        warnings.stream().forEach(header -> response.addHeader(header));
    }
@Test
    public void testInterceptorMultipleHeaderFilteredWarning2() throws IOException, HttpException {
        OpenSearchFilterDeprecationWarningsInterceptor interceptor = new OpenSearchFilterDeprecationWarningsInterceptor();

        HttpResponse response = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("HTTP", 0, 0), 0, null));
        response.addHeader("Test", "This header should not trigger the interceptor.");
        response.addHeader("Warning", "This warning should not trigger the interceptor.");
        response.addHeader("Warning", "This text contains the trigger: but in a future major version, direct access to system indices and their aliases will not be allowed - and should be filtered out");

        assertThat(response.getAllHeaders())
                .as("Number of Headers should be 3 before start.")
                .hasSize(3);

        interceptor.process(response, null);

        assertThat(response.getAllHeaders())
                .as("Number of Headers should be 1 less after running the interceptor.")
                .hasSize(2);
    }