public void register(final String consumerGroup, final Collection<SubscriptionData> subList) {
        for (SubscriptionData subscriptionData : subList) {
            register(
                subscriptionData.getTopic(),
                consumerGroup,
                subscriptionData.getSubString(),
                subscriptionData.getExpressionType(),
                subscriptionData.getSubVersion()
            );
        }

        // make illegal topic dead.
        Collection<ConsumerFilterData> groupFilterData = getByGroup(consumerGroup);

        Iterator<ConsumerFilterData> iterator = groupFilterData.iterator();
        while (iterator.hasNext()) {
            ConsumerFilterData filterData = iterator.next();

            boolean exist = false;
            for (SubscriptionData subscriptionData : subList) {
                if (subscriptionData.getTopic().equals(filterData.getTopic())) {
                    exist = true;
                    break;
                }
            }

            if (!exist && !filterData.isDead()) {
                filterData.setDeadTime(System.currentTimeMillis());
                log.info("Consumer filter changed: {}, make illegal topic dead:{}", consumerGroup, filterData);
            }
        }
    }
@Test
    public void testRegister() {
        ConsumerFilterManager filterManager = gen(10, 10);

        ConsumerFilterData filterData = filterManager.get("topic9", "CID_9");

        assertThat(filterData).isNotNull();
        assertThat(filterData.isDead()).isFalse();

        // new version
        assertThat(filterManager.register(
            "topic9", "CID_9", "a is not null", ExpressionType.SQL92, System.currentTimeMillis() + 1000
        )).isTrue();

        ConsumerFilterData newFilter = filterManager.get("topic9", "CID_9");

        assertThat(newFilter).isNotEqualTo(filterData);

        // same version
        assertThat(filterManager.register(
            "topic9", "CID_9", "a is null", ExpressionType.SQL92, newFilter.getClientVersion()
        )).isFalse();

        ConsumerFilterData filterData1 = filterManager.get("topic9", "CID_9");

        assertThat(newFilter).isEqualTo(filterData1);
    }