@Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    var requestIdGenerator = platform.getContainer().getOptionalComponentByType(RequestIdGenerator.class);

    if (requestIdGenerator.isEmpty()) {
      chain.doFilter(request, response);
    } else {
      String requestId = requestIdGenerator.get().generate();
      try (RequestIdMDCStorage mdcStorage = new RequestIdMDCStorage(requestId)) {
        request.setAttribute("ID", requestId);
        chain.doFilter(request, response);
      }
    }
  }
@Test
  public void filter_adds_requestId_to_request_passed_on_to_chain() throws IOException, ServletException {
    String requestId = "request id";
    when(requestIdGenerator.generate()).thenReturn(requestId);

    underTest.doFilter(servletRequest, servletResponse, filterChain);

    verify(servletRequest).setAttribute("ID", requestId);
  }