public static Map<TConsensusGroupId, Integer> countDataPartition(
      Map<TSeriesPartitionSlot, Map<TTimePartitionSlot, List<TConsensusGroupId>>>
          dataPartitionMap) {
    Map<TConsensusGroupId, AtomicInteger> counter = new ConcurrentHashMap<>();
    dataPartitionMap.forEach(
        ((seriesPartitionSlot, timePartitionSlotMap) ->
            timePartitionSlotMap.forEach(
                ((timePartitionSlot, consensusGroupIds) ->
                    consensusGroupIds.forEach(
                        (consensusGroupId ->
                            counter
                                .computeIfAbsent(consensusGroupId, empty -> new AtomicInteger(0))
                                .incrementAndGet()))))));
    return counter.entrySet().stream()
        .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().get()));
  }
Generate a PatternTree and serialize it into a ByteBuffer
integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java