class SchedulerLockInterceptor implements MethodInterceptor<Object, Object> {
    private final LockingTaskExecutor lockingTaskExecutor;
    private final MicronautLockConfigurationExtractor micronautLockConfigurationExtractor;

    public SchedulerLockInterceptor(
            LockProvider lockProvider,
            Optional<ConversionService> conversionService,
            @Value("${shedlock.defaults.lock-at-most-for}") String defaultLockAtMostFor,
            @Value("${shedlock.defaults.lock-at-least-for:PT0S}") String defaultLockAtLeastFor) {
        /*
         * From Micronaut 3 to 4, ConversionService changes from a parameterized type to
         * a non-parameterized one, so some raw type usage and unchecked casts are done
         * to support both Micronaut versions.
         */
        ConversionService resolvedConversionService = conversionService.orElse(ConversionService.SHARED);

        lockingTaskExecutor = new DefaultLockingTaskExecutor(lockProvider);

        micronautLockConfigurationExtractor = new MicronautLockConfigurationExtractor(
                convert(resolvedConversionService, defaultLockAtMostFor, "defaultLockAtMostFor"),
                convert(resolvedConversionService, defaultLockAtLeastFor, "defaultLockAtLeastFor"),
                resolvedConversionService);
    }

    private static Duration convert(
            ConversionService resolvedConversionService, String defaultLockAtMostFor, String label) {<FILL_FUNCTION_BODY>}

    @Override
    public Object intercept(MethodInvocationContext<Object, Object> context) {
        Class<?> returnType = context.getReturnType().getType();
        if (!void.class.equals(returnType) && !Void.class.equals(returnType)) {
            throw new LockingNotSupportedException();
        }

        Optional<LockConfiguration> lockConfiguration =
                micronautLockConfigurationExtractor.getLockConfiguration(context.getExecutableMethod());
        if (lockConfiguration.isPresent()) {
            lockingTaskExecutor.executeWithLock((Runnable) context::proceed, lockConfiguration.get());
            return null;
        } else {
            return context.proceed();
        }
    }
}

        return resolvedConversionService
                .convert(defaultLockAtMostFor, Duration.class)
                .orElseThrow(() -> new IllegalArgumentException("Invalid '" + label + "' value"));
    
<no_super_class>