class KqueueProvider {

    private static final InternalLogger logger = InternalLoggerFactory.getInstance(KqueueProvider.class);

    private static final String KQUEUE_ENABLED_KEY = "io.lettuce.core.kqueue";

    private static final boolean KQUEUE_ENABLED = Boolean.parseBoolean(SystemPropertyUtil.get(KQUEUE_ENABLED_KEY, "true"));

    private static final boolean KQUEUE_AVAILABLE;

    private static final EventLoopResources KQUEUE_RESOURCES;

    static {

        boolean availability;
        try {
            Class.forName("io.netty.channel.kqueue.KQueue");
            availability = KQueue.isAvailable();
        } catch (ClassNotFoundException e) {
            availability = false;
        }

        KQUEUE_AVAILABLE = availability;

        if (KQUEUE_AVAILABLE) {
            logger.debug("Starting with kqueue library");
            KQUEUE_RESOURCES = new EventLoopResourcesWrapper(KqueueResources.INSTANCE, KqueueProvider::checkForKqueueLibrary);

        } else {
            logger.debug("Starting without optional kqueue library");
            KQUEUE_RESOURCES = new EventLoopResourcesWrapper(UnavailableResources.INSTANCE,
                    KqueueProvider::checkForKqueueLibrary);
        }
    }

    /**
     * @return {@code true} if kqueue is available.
     */
    public static boolean isAvailable() {
        return KQUEUE_AVAILABLE && KQUEUE_ENABLED;
    }

    /**
     * Check whether the kqueue library is available on the class path.
     *
     * @throws IllegalStateException if the {@literal netty-transport-native-kqueue} library is not available
     */
    static void checkForKqueueLibrary() {<FILL_FUNCTION_BODY>}

    /**
     * Returns the {@link EventLoopResources} for kqueue-backed transport. Check availability with {@link #isAvailable()} prior
     * to obtaining the resources.
     *
     * @return the {@link EventLoopResources}. May be unavailable.
     *
     * @since 6.0
     */
    public static EventLoopResources getResources() {
        return KQUEUE_RESOURCES;
    }

    /**
     * {@link EventLoopResources} for unavailable Kqueue.
     */
    enum UnavailableKqueueResources implements EventLoopResources {

        INSTANCE;

        @Override
        public boolean matches(Class<? extends EventExecutorGroup> type) {

            checkForKqueueLibrary();
            return false;
        }

        @Override
        public Class<? extends EventLoopGroup> eventLoopGroupClass() {

            checkForKqueueLibrary();
            return null;
        }

        @Override
        public EventLoopGroup newEventLoopGroup(int nThreads, ThreadFactory threadFactory) {

            checkForKqueueLibrary();
            return null;
        }

        @Override
        public Class<? extends Channel> socketChannelClass() {

            checkForKqueueLibrary();
            return null;
        }

        @Override
        public Class<? extends Channel> domainSocketChannelClass() {

            checkForKqueueLibrary();
            return null;
        }

        @Override
        public SocketAddress newSocketAddress(String socketPath) {

            checkForKqueueLibrary();
            return null;
        }

        @Override
        public Class<? extends DatagramChannel> datagramChannelClass() {


            checkForKqueueLibrary();
            return null;
        }


    }

    /**
     * {@link EventLoopResources} for available kqueue.
     */
    enum KqueueResources implements EventLoopResources {

        INSTANCE;

        @Override
        public boolean matches(Class<? extends EventExecutorGroup> type) {

            LettuceAssert.notNull(type, "EventLoopGroup type must not be null");

            return type.equals(eventLoopGroupClass());
        }

        @Override
        public Class<? extends EventLoopGroup> eventLoopGroupClass() {

            checkForKqueueLibrary();

            return KQueueEventLoopGroup.class;
        }

        @Override
        public EventLoopGroup newEventLoopGroup(int nThreads, ThreadFactory threadFactory) {

            checkForKqueueLibrary();

            return new KQueueEventLoopGroup(nThreads, threadFactory);
        }

        @Override
        public Class<? extends Channel> socketChannelClass() {

            checkForKqueueLibrary();

            return KQueueSocketChannel.class;
        }

        @Override
        public Class<? extends DatagramChannel> datagramChannelClass() {

            checkForKqueueLibrary();

            return KQueueDatagramChannel.class;
        }


        @Override
        public Class<? extends Channel> domainSocketChannelClass() {

            checkForKqueueLibrary();

            return KQueueDomainSocketChannel.class;
        }


        @Override
        public SocketAddress newSocketAddress(String socketPath) {

            checkForKqueueLibrary();

            return new DomainSocketAddress(socketPath);
        }

    }

}


        LettuceAssert.assertState(KQUEUE_ENABLED,
                String.format("kqueue use is disabled via System properties (%s)", KQUEUE_ENABLED_KEY));
        LettuceAssert.assertState(isAvailable(),
                "netty-transport-native-kqueue is not available. Make sure netty-transport-native-kqueue library on the class path and supported by your operating system.");
    
<no_super_class>