@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_does_not_add_requestId_to_request_passed_on_to_chain_when_there_is_no_RequestIdGenerator_in_container() throws IOException, ServletException {
    ExtensionContainer container = mock(ExtensionContainer.class);
    when(container.getOptionalComponentByType(RequestIdGenerator.class)).thenReturn(Optional.empty());
    when(platform.getContainer()).thenReturn(container);
    RequestIdFilter underTest = new RequestIdFilter(platform);

    underTest.doFilter(servletRequest, servletResponse, filterChain);

    verify(servletRequest, times(0)).setAttribute(anyString(), anyString());
  }