### Question:
MultiQueueLlamaAM extends LlamaAMImpl implements LlamaAMListener,
    IntraLlamaAMsCallback { @Override @SuppressWarnings("unchecked") public List<PlacedReservation> releaseReservationsForQueue(String queue, boolean doNotCache) throws LlamaException { List<PlacedReservation> list; SingleQueueAMInfo amInfo; synchronized (ams) { amInfo = ((doNotCache) ? ams.remove(queue) : ams.get(queue)); } if (amInfo != null) { list = amInfo.am.releaseReservationsForQueue(queue, doNotCache); amInfo.decrementReservations( list.size()); if (doNotCache) { amInfo.am.stop(); } } else { list = Collections.EMPTY_LIST; } return list; } MultiQueueLlamaAM(Configuration conf); @Override synchronized void setMetricRegistry(MetricRegistry metricRegistry); @Override void onEvent(LlamaAMEvent event); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override List<NodeInfo> getNodes(); @SuppressWarnings("deprecation") @Override void reserve(UUID reservationId, Reservation reservation); @SuppressWarnings("deprecation") @Override PlacedReservation getReservation(UUID reservationId); @SuppressWarnings("deprecation") @Override PlacedReservation releaseReservation(UUID handle, UUID reservationId,
      boolean doNotCache); @Override List<PlacedReservation> releaseReservationsForHandle(UUID handle,
      boolean doNotCache); @Override @SuppressWarnings("unchecked") List<PlacedReservation> releaseReservationsForQueue(String queue,
      boolean doNotCache); @Override void emptyCacheForQueue(String queue); @Override void discardAM(String queue); @Override void discardReservation(UUID reservationId);  }### Answer:
@Test public void testReleaseReservationsForQueue() throws Exception { Configuration conf = new Configuration(false); conf.setClass(LlamaAM.RM_CONNECTOR_CLASS_KEY, MyRMConnector.class, RMConnector.class); MultiQueueLlamaAM am = new MultiQueueLlamaAM(conf); am.start(); UUID handle = UUID.randomUUID(); am.reserve(TestUtils.createReservation(handle, "root.q1", 1, true)); Assert.assertTrue(am.ams.containsKey("root.q1")); am.releaseReservationsForQueue("root.q1", true); Assert.assertFalse(am.ams.containsKey("root.q1")); am.releaseReservationsForQueue("root.q1", true); am.releaseReservationsForQueue("root.q1", false); Assert.assertFalse(am.ams.containsKey("root.q1")); am.reserve(TestUtils.createReservation(handle, "root.q2", 1, true)); Assert.assertTrue(am.ams.containsKey("root.q2")); am.releaseReservationsForQueue("root.q2", false); Assert.assertTrue(am.ams.containsKey("root.q2")); am.releaseReservationsForQueue("root.q2", false); am.releaseReservationsForQueue("root.q2", true); Assert.assertFalse(am.ams.containsKey("root.q2")); }