### Question:
FairScheduler implements ResourceScheduler { public QueueManager getQueueManager() { return queueMgr; } FairScheduler(); FairSchedulerConfiguration getConf(); QueueManager getQueueManager(); RMContainerTokenSecretManager getContainerTokenSecretManager(); synchronized double getAppWeight(AppSchedulable app); @Override Resource getMinimumResourceCapability(); @Override Resource getMaximumResourceCapability(); double getNodeLocalityThreshold(); double getRackLocalityThreshold(); Resource getClusterCapacity(); Clock getClock(); FairSchedulerEventLog getEventLog(); @Override Allocation allocate(ApplicationAttemptId appAttemptId,
      List<ResourceRequest> ask, List<ContainerId> release); @Override SchedulerNodeReport getNodeReport(NodeId nodeId); FSSchedulerApp getSchedulerApp(ApplicationAttemptId appAttemptId); @Override SchedulerAppReport getSchedulerAppInfo(
      ApplicationAttemptId appAttemptId); @Override QueueMetrics getRootQueueMetrics(); @Override void handle(SchedulerEvent event); @Override void recover(RMState state); @Override synchronized void reinitialize(Configuration conf, RMContext rmContext); @Override QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
      boolean recursive); @Override List<QueueUserACLInfo> getQueueUserAclInfo(); @Override int getNumClusterNodes(); static final Resource CONTAINER_RESERVED; }### Answer:
@Test public void testHierarchicalQueuesSimilarParents() { QueueManager queueManager = scheduler.getQueueManager(); FSLeafQueue leafQueue = queueManager.getLeafQueue("parent.child"); Assert.assertEquals(2, queueManager.getLeafQueues().size()); Assert.assertNotNull(leafQueue); Assert.assertEquals("root.parent.child", leafQueue.getName()); FSLeafQueue leafQueue2 = queueManager.getLeafQueue("parent"); Assert.assertNull(leafQueue2); Assert.assertEquals(2, queueManager.getLeafQueues().size()); FSLeafQueue leafQueue3 = queueManager.getLeafQueue("parent.child.grandchild"); Assert.assertNull(leafQueue3); Assert.assertEquals(2, queueManager.getLeafQueues().size()); FSLeafQueue leafQueue4 = queueManager.getLeafQueue("parent.sister"); Assert.assertNotNull(leafQueue4); Assert.assertEquals("root.parent.sister", leafQueue4.getName()); Assert.assertEquals(3, queueManager.getLeafQueues().size()); }