public static MappingAllocator buildMappingAllocator(Map<Integer, String> idToBroker, Map<String, Integer> brokerNumMap, Map<String, Integer> brokerNumMapBeforeRemapping) {
        return new MappingAllocator(idToBroker, brokerNumMap, brokerNumMapBeforeRemapping);
    }
@Test
    public void testAllocator() {
        //stability
        for (int i = 0; i < 10; i++) {
            int num = 3;
            Map<String, Integer> brokerNumMap = buildBrokerNumMap(num);
            TopicQueueMappingUtils.MappingAllocator  allocator = TopicQueueMappingUtils.buildMappingAllocator(new HashMap<>(), brokerNumMap,  null);
            allocator.upToNum(num * 2);
            for (Map.Entry<String, Integer> entry: allocator.getBrokerNumMap().entrySet()) {
                Assert.assertEquals(2L, entry.getValue().longValue());
            }
            Assert.assertEquals(num * 2, allocator.getIdToBroker().size());
            testIdToBroker(allocator.idToBroker, allocator.getBrokerNumMap());

            allocator.upToNum(num * 3 - 1);

            for (Map.Entry<String, Integer> entry: allocator.getBrokerNumMap().entrySet()) {
                Assert.assertTrue(entry.getValue() >= 2);
                Assert.assertTrue(entry.getValue() <= 3);
            }
            Assert.assertEquals(num * 3 - 1, allocator.getIdToBroker().size());
            testIdToBroker(allocator.idToBroker, allocator.getBrokerNumMap());
        }
    }