public static Optional<DefaultLitePullConsumerWrapper> wrapPullConsumer(
            DefaultLitePullConsumer pullConsumer) {
        // 获取消费者相关的defaultLitePullConsumerImpl、rebalanceImpl和mQClientFactory属性值，若获取失败说明消费者启动失败，不缓存该消费者
        Optional<DefaultLitePullConsumerImpl> pullConsumerImplOptional = getPullConsumerImpl(pullConsumer);
        if (!pullConsumerImplOptional.isPresent()) {
            return Optional.empty();
        }
        DefaultLitePullConsumerImpl pullConsumerImpl = pullConsumerImplOptional.get();

        Optional<RebalanceImpl> rebalanceImplOptional = getRebalanceImpl(pullConsumerImpl);
        if (!rebalanceImplOptional.isPresent()) {
            return Optional.empty();
        }
        RebalanceImpl rebalanceImpl = rebalanceImplOptional.get();

        Optional<MQClientInstance> clientFactoryOptional = getClientFactory(pullConsumerImpl);
        if (!clientFactoryOptional.isPresent()) {
            return Optional.empty();
        }
        MQClientInstance clientFactory = clientFactoryOptional.get();

        DefaultLitePullConsumerWrapper wrapper = new DefaultLitePullConsumerWrapper(pullConsumer, pullConsumerImpl,
                rebalanceImpl, clientFactory);
        initWrapperServiceMeta(wrapper);
        return Optional.of(wrapper);
    }
@Test
    public void testWrapPullConsumer() {
        Optional<DefaultLitePullConsumerWrapper> pullConsumerWrapperOptional = RocketMqWrapperUtils
                .wrapPullConsumer(pullConsumer);
        Assert.assertTrue(pullConsumerWrapperOptional.isPresent());
        Assert.assertEquals(pullConsumerWrapperOptional.get().getPullConsumer(), pullConsumer);
    }