private static void addQueue(
          QueueConfigInfo addInfo, CapacitySchedulerConfiguration proposedConf,
          Map<String, String> confUpdate) throws IOException {
    if (addInfo == null) {
      return;
    }
    QueuePath queuePath = new QueuePath(addInfo.getQueue());
    String queueName = queuePath.getLeafName();
    if (queuePath.isRoot() || queuePath.isInvalid()) {
      throw new IOException("Can't add invalid queue " + queuePath);
    } else if (getSiblingQueues(queuePath, proposedConf).contains(
            queueName)) {
      throw new IOException("Can't add existing queue " + queuePath);
    }

    QueuePath parentPath = queuePath.getParentObject();
    List<String> siblingQueues = proposedConf.getQueues(parentPath);
    siblingQueues.add(queueName);
    proposedConf.setQueues(parentPath,
            siblingQueues.toArray(new String[0]));
    confUpdate.put(getQueuesConfig(parentPath),
            Joiner.on(',').join(siblingQueues));
    String keyPrefix = QueuePrefixes.getQueuePrefix(queuePath);
    for (Map.Entry<String, String> kv : addInfo.getParams().entrySet()) {
      String keyValue = kv.getValue();
      if (keyValue == null || keyValue.isEmpty()) {
        proposedConf.unset(keyPrefix + kv.getKey());
        confUpdate.put(keyPrefix + kv.getKey(), null);
      } else {
        proposedConf.set(keyPrefix + kv.getKey(), keyValue);
        confUpdate.put(keyPrefix + kv.getKey(), keyValue);
      }
    }
    // Unset Ordering Policy of Parent Queue converted from
    // Leaf Queue after addQueue
    String queueOrderingPolicy = getOrderingPolicyConfig(parentPath);
    if (siblingQueues.size() == 1) {
      proposedConf.unset(queueOrderingPolicy);
      confUpdate.put(queueOrderingPolicy, null);
    }
  }
@Test
  public void testAddQueue() throws Exception {
    SchedConfUpdateInfo updateInfo = new SchedConfUpdateInfo();
    Map<String, String> updateMap = new HashMap<>();
    updateMap.put(CONFIG_NAME, C_CONFIG_VALUE);
    QueueConfigInfo queueConfigInfo = new QueueConfigInfo(C_PATH, updateMap);
    updateInfo.getAddQueueInfo().add(queueConfigInfo);

    Map<String, String> configurationUpdate =
            ConfigurationUpdateAssembler.constructKeyValueConfUpdate(csConfig, updateInfo);

    assertEquals(C_CONFIG_VALUE, configurationUpdate.get(C_CONFIG_PATH));
    assertEquals("a,b,c", configurationUpdate.get(ROOT_QUEUES_PATH));
  }