### Question:
AdjustQueueNumStrategy { public boolean isCanAdjustReadQueueSize(String topic, int scaleQueueSize) { TopicConfig topicConfig = deFiBrokerController.getTopicConfigManager().getTopicConfigTable().get(topic); if (topicConfig != null) { for (int qId = scaleQueueSize; qId < topicConfig.getReadQueueNums(); qId++) { long maxOffsetInConsumeQueue = deFiBrokerController.getMessageStore().getMaxOffsetInQueue(topic, qId); long lastMsgTime = deFiBrokerController.getMessageStore().getMessageStoreTimeStamp(topic, qId, maxOffsetInConsumeQueue - 1); long diff = System.currentTimeMillis() - lastMsgTime; if (diff < 60 * 1000) { log.info("adjust queue num, still new message in within {} ms, default threshold 60000 ms", System.currentTimeMillis() - lastMsgTime); return false; } Set<String> topicConsumeByWho = this.deFiBrokerController.getConsumerManager().queryTopicConsumeByWho(topic); Set<String> groupInOffset = this.deFiBrokerController.getConsumerOffsetManager().whichGroupByTopic(topic); if (groupInOffset != null && !groupInOffset.isEmpty()) { topicConsumeByWho.addAll(groupInOffset); } boolean allConsumed = isAllMessageConsumed(topic, topicConsumeByWho, qId); if (!allConsumed) { return false; } } return true; } return false; } AdjustQueueNumStrategy(final DeFiBrokerController deFiBrokerController); void increaseQueueNum(String topic); void decreaseQueueNum(String topic); void notifyWhenTopicConfigChange(String topic); boolean isCanAdjustReadQueueSize(String topic, int scaleQueueSize);  }### Answer:
@Test public void testIsCanAdjustReadQueueSizeByFalse() { deFiBrokerController.getTopicConfigManager().updateTopicConfig(createTopic()); when(messageStore.getMaxOffsetInQueue(anyString(), anyInt())).thenReturn(1000L); when(messageStore.getMessageStoreTimeStamp(anyString(), anyInt(), anyLong())).thenReturn(System.currentTimeMillis()); boolean flag = adjustQueueNumStrategy.isCanAdjustReadQueueSize(topic, 3); assertThat(flag).isFalse(); }
@Test public void testIsCanAdjustReadQueueSizeByTrue() { deFiBrokerController.getTopicConfigManager().updateTopicConfig(createTopic()); boolean flag = adjustQueueNumStrategy.isCanAdjustReadQueueSize(topic, 4); assertThat(flag).isTrue(); }