@Test
public void testFromYarnQueue() {

  //Define child queue
  org.apache.hadoop.yarn.api.records.QueueInfo child =
    Mockito.mock(org.apache.hadoop.yarn.api.records.QueueInfo.class);
  Mockito.when(child.getQueueState()).thenReturn(QueueState.RUNNING);
  //Define parent queue
  org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
    Mockito.mock(org.apache.hadoop.yarn.api.records.QueueInfo.class);
  List<org.apache.hadoop.yarn.api.records.QueueInfo> children =
    new ArrayList<org.apache.hadoop.yarn.api.records.QueueInfo>();
  children.add(child); //Add one child
  Mockito.when(queueInfo.getChildQueues()).thenReturn(children);
  Mockito.when(queueInfo.getQueueState()).thenReturn(QueueState.RUNNING);
  //Call the function we're testing
  org.apache.hadoop.mapreduce.QueueInfo returned =
    TypeConverter.fromYarn(queueInfo, new Configuration());
  //Verify that the converted queue has the 1 child we had added
  Assert.assertEquals("QueueInfo children weren't properly converted",
    returned.getQueueChildren().size(), 1);
}