@VisibleForTesting
    static Map<ChannelOption<?>, Object> applyDefaultChannelOptions(
            boolean enabled, TransportType transportType, Map<ChannelOption<?>, Object> channelOptions,
            long idleTimeoutMillis, long pingIntervalMillis) {
        if (!enabled) {
            return channelOptions;
        }

        final ImmutableMap.Builder<ChannelOption<?>, Object> newChannelOptionsBuilder = ImmutableMap.builder();

        if (idleTimeoutMillis > 0) {
            final int tcpUserTimeout = Ints.saturatedCast(idleTimeoutMillis + TCP_USER_TIMEOUT_BUFFER_MILLIS);
            if (transportType == TransportType.EPOLL &&
                canAddChannelOption(epollTcpUserTimeout, channelOptions)) {
                assert epollTcpUserTimeout != null;
                putChannelOption(newChannelOptionsBuilder, epollTcpUserTimeout, tcpUserTimeout);
            } else if (transportType == TransportType.IO_URING &&
                       canAddChannelOption(ioUringTcpUserTimeout, channelOptions)) {
                assert ioUringTcpUserTimeout != null;
                putChannelOption(newChannelOptionsBuilder, ioUringTcpUserTimeout, tcpUserTimeout);
            }
        }

        if (pingIntervalMillis > 0) {
            final int intPingIntervalMillis = Ints.saturatedCast(pingIntervalMillis);
            if (transportType == TransportType.EPOLL &&
                canAddChannelOption(epollTcpKeepidle, channelOptions) &&
                canAddChannelOption(epollTcpKeepintvl, channelOptions) &&
                canAddChannelOption(ChannelOption.SO_KEEPALIVE, channelOptions)) {
                assert epollTcpKeepidle != null;
                assert epollTcpKeepintvl != null;
                putChannelOption(newChannelOptionsBuilder, ChannelOption.SO_KEEPALIVE, true);
                putChannelOption(newChannelOptionsBuilder, epollTcpKeepidle, intPingIntervalMillis);
                putChannelOption(newChannelOptionsBuilder, epollTcpKeepintvl, intPingIntervalMillis);
            } else if (transportType == TransportType.IO_URING &&
                       canAddChannelOption(ioUringTcpKeepidle, channelOptions) &&
                       canAddChannelOption(ioUringTcpKeepintvl, channelOptions) &&
                       canAddChannelOption(ChannelOption.SO_KEEPALIVE, channelOptions)) {
                assert ioUringTcpKeepidle != null;
                assert ioUringTcpKeepintvl != null;
                putChannelOption(newChannelOptionsBuilder, ChannelOption.SO_KEEPALIVE, true);
                putChannelOption(newChannelOptionsBuilder, ioUringTcpKeepidle, intPingIntervalMillis);
                putChannelOption(newChannelOptionsBuilder, ioUringTcpKeepintvl, intPingIntervalMillis);
            }
        }
        newChannelOptionsBuilder.putAll(channelOptions);
        return newChannelOptionsBuilder.build();
    }
Finds the {@link SSLSession} of the current TLS connection.

@return the {@link SSLSession} if found, or {@code null} if not found or {@link Channel} is {@code null}.
core/src/main/java/com/linecorp/armeria/internal/common/util/ChannelUtil.java