### Question:
QueueConfig extends SerializableBase { public boolean updatePriority(Map<String, Integer> newPriority) { if (CollectionUtils.isEmpty(newPriority) && !CollectionUtils.isEmpty(priority)) { this.priority = new HashMap<>(); return true; } if (CollectionUtils.isEmpty(newPriority)) { return false; } boolean updated = false; Map<String, Integer> updatedPriority = new HashMap<>(priority); for (Entry<String, Integer> entry : newPriority.entrySet()) { Integer val = priority.get(entry.getKey()); if (val == null || !val.equals(entry.getValue())) { updated = true; updatedPriority.put(entry.getKey(), entry.getValue()); } } for (String key : priority.keySet()) { Integer val = newPriority.get(key); if (val == null) { updated = true; updatedPriority.remove(key); } } if (updated) { this.priority = updatedPriority; } return updated; }  void updateTime(); boolean updateRetryCount(int newRetryCount); boolean addDeadLetterQueue(DeadLetterQueue deadLetterQueue); boolean updateVisibilityTimeout(long newTimeOut); boolean updateConcurrency(MinMax<Integer> concurrency); boolean updatePriorityGroup(String priorityGroup); boolean updatePriority(Map<String, Integer> newPriority); @JsonIgnore boolean isDeadLetterQueue(String name); @JsonIgnore boolean hasDeadLetterQueue();  }### Answer:
@Test public void updatePriority() { QueueConfig queueConfig = TestUtils.createQueueConfig("test"); Map<String, Integer> priorityMap = new HashMap<>(); priorityMap.put(Constants.DEFAULT_PRIORITY_KEY, 100); priorityMap.put("critical", 100); priorityMap.put("high", 50); assertTrue(queueConfig.updatePriority(priorityMap)); assertEquals(priorityMap, queueConfig.getPriority()); assertFalse(queueConfig.updatePriority(priorityMap)); priorityMap = new HashMap<>(); priorityMap.put("critical", 100); priorityMap.put("high", 20); priorityMap.put("low", 50); assertTrue(queueConfig.updatePriority(priorityMap)); assertEquals(priorityMap, queueConfig.getPriority()); assertFalse(queueConfig.updatePriority(priorityMap)); }