### Question:
QueueDetail { List<QueueDetail> expandQueueDetail(boolean addDefault, int priority) { List<QueueDetail> queueDetails = new ArrayList<>(); for (Entry<String, Integer> entry : getPriority().entrySet()) { QueueDetail cloneQueueDetail = cloneQueueDetail(entry.getKey(), entry.getValue(), true, name); queueDetails.add(cloneQueueDetail); } if (addDefault) { int defaultPriority = priority; if (defaultPriority == -1) { List<Integer> priorities = new ArrayList<>(getPriority().values()); priorities.sort(Comparator.comparingInt(o -> o)); defaultPriority = priorities.get(priorities.size() / 2); } Map<String, Integer> priorityMap = new HashMap<>(this.priority); priorityMap.put(Constants.DEFAULT_PRIORITY_KEY, defaultPriority); this.priority = Collections.unmodifiableMap(priorityMap); this.priorityGroup = name; queueDetails.add(this); } return queueDetails; }  boolean isDlqSet(); DeadLetterQueue getDeadLetterQueue(); QueueConfig toConfig();  }### Answer:
@Test public void expandQueueDetail() { Map<String, Integer> priority = new HashMap<>(); priority.put("critical", 10); priority.put("high", 5); QueueDetail queueDetail = TestUtils.createQueueDetail("test", priority, 3, 1000L, null); List<QueueDetail> queueDetails = queueDetail.expandQueueDetail(true, -1); priority.put(Constants.DEFAULT_PRIORITY_KEY, 5); QueueDetail queueDetail2 = QueueDetail.builder() .name(queueDetail.getName() + "_critical") .numRetry(queueDetail.getNumRetry()) .queueName(queueDetail.getQueueName() + "_critical") .delayedQueueName(queueDetail.getDelayedQueueName() + "_critical") .delayedQueueChannelName(queueDetail.getDelayedQueueChannelName() + "_critical") .processingQueueName(queueDetail.getProcessingQueueName() + "_critical") .processingQueueChannelName(queueDetail.getProcessingQueueChannelName() + "_critical") .visibilityTimeout(queueDetail.getVisibilityTimeout()) .concurrency(queueDetail.getConcurrency()) .priority(Collections.singletonMap(Constants.DEFAULT_PRIORITY_KEY, 10)) .priorityGroup(queueDetail.getName()) .active(true) .systemGenerated(true) .build(); QueueDetail queueDetail3 = QueueDetail.builder() .name(queueDetail.getName() + "_high") .numRetry(queueDetail.getNumRetry()) .queueName(queueDetail.getQueueName() + "_high") .delayedQueueName(queueDetail.getDelayedQueueName() + "_high") .delayedQueueChannelName(queueDetail.getDelayedQueueChannelName() + "_high") .processingQueueName(queueDetail.getProcessingQueueName() + "_high") .processingQueueChannelName(queueDetail.getProcessingQueueChannelName() + "_high") .visibilityTimeout(queueDetail.getVisibilityTimeout()) .concurrency(queueDetail.getConcurrency()) .priority(Collections.singletonMap(Constants.DEFAULT_PRIORITY_KEY, 5)) .priorityGroup(queueDetail.getName()) .systemGenerated(true) .active(true) .build(); assertEquals(3, queueDetails.size()); assertEquals(queueDetail3, queueDetails.get(0)); assertEquals(queueDetail2, queueDetails.get(1)); assertEquals(queueDetail, queueDetails.get(2)); }