FSParentQueue extends FSQueue { @Override public List<FSQueue> getChildQueues() { readLock.lock(); try { return ImmutableList.copyOf(childQueues); } finally { readLock.unlock(); } } FSParentQueue(String name, FairScheduler scheduler,
      FSParentQueue parent); @Override Resource getMaximumContainerAllocation(); @Override Resource getDemand(); @Override void updateDemand(); @Override List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user); @Override Resource assignContainer(FSSchedulerNode node); @Override List<FSQueue> getChildQueues(); @Override int getNumRunnableApps(); @Override boolean isEmpty(); @Override void collectSchedulerApplications(
      Collection<ApplicationAttemptId> apps); @Override ActiveUsersManager getAbstractUsersManager(); @Override void recoverContainer(Resource clusterResource,
      SchedulerApplicationAttempt schedulerAttempt, RMContainer rmContainer);  }
@Test public void testConcurrentChangeToGetChildQueue() { queueManager.getLeafQueue("parent.child", true); queueManager.getLeafQueue("parent.child2", true); FSParentQueue test = queueManager.getParentQueue("parent", false); assertEquals(2, test.getChildQueues().size()); boolean first = true; int childQueuesFound = 0; for (FSQueue childQueue:test.getChildQueues()) { if (first) { first = false; queueManager.getLeafQueue("parent.child3", true); } childQueuesFound++; } assertEquals(2, childQueuesFound); assertEquals(3, test.getChildQueues().size()); }