@Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
    if (handler instanceof HandlerMethod handlerMethod) {
      preHandle(handlerMethod, request);
    } else {
      LOGGER.debug("Handler is not a HandlerMethod, skipping deprecated check.");
    }

    return true;
  }
@Test
  public void preHandle_whenNotHandlerMethod_shouldLogDebugMessage() {
    DeprecatedHandler handler = new DeprecatedHandler(userSession);

    boolean result = handler.preHandle(mock(HttpServletRequest.class), mock(HttpServletResponse.class), "Not handler");

    assertThat(result).isTrue();
    assertThat(logTester.logs(Level.DEBUG)).contains("Handler is not a HandlerMethod, skipping deprecated check.");
  }