@Test
public void testPerQueueDisablePreemptionBroadHierarchical() {

  int[][] qData = new int[][] {
      //  /    A              D              G    
      //            B    C         E    F         H    I
      {1000, 350, 150, 200, 400, 200, 200, 250, 100, 150 },  // abs
      {1000,1000,1000,1000,1000,1000,1000,1000,1000,1000 },  // maxCap
      {1000, 400, 200, 200, 400, 250, 150, 200, 150,  50 },  // used
      {  50,   0,   0,   0,  50,   0,  50,   0,   0,   0 },  // pending
      {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },  // reserved
      //          appA appB      appC appD      appE appF
      {   6,   2,   1,   1,   2,   1,   1,   2,   1,   1 },  // apps
      {  -1,  -1,   1,   1,  -1,   1,   1,  -1,   1,   1 },  // req granulrity
      {   3,   2,   0,   0,   2,   0,   0,   2,   0,   0 },  // subqueues
    };
  ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData);
  policy.editSchedule();
  // queueF(appD) wants resources, Verify that resources come from queueE(appC)
  // because it's a sibling and queueB(appA) because queueA is over capacity.
  verify(mDisp, times(28)).handle(argThat(new IsPreemptionRequestFor(appA)));
  verify(mDisp, times(22)).handle(argThat(new IsPreemptionRequestFor(appC)));
  // Need to call setup() again to reset mDisp
  setup();
  // Turn off preemption for queueB(appA)
  schedConf.setPreemptionDisabled("root.queueA.queueB", true);
  ProportionalCapacityPreemptionPolicy policy2 = buildPolicy(qData);
  policy2.editSchedule();
  // Now that queueB(appA) is not preemptable, verify that resources come
  // from queueE(appC)
  verify(mDisp, times(50)).handle(argThat(new IsPreemptionRequestFor(appC)));
  verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appA)));
  setup();
  // Turn off preemption for two of the 3 queues with over-capacity.
  schedConf.setPreemptionDisabled("root.queueD.queueE", true);
  schedConf.setPreemptionDisabled("root.queueA.queueB", true);
  ProportionalCapacityPreemptionPolicy policy3 = buildPolicy(qData);
  policy3.editSchedule();
  // Verify that the request was starved out even though queueH(appE) is
  // over capacity. This is because queueG (queueH's parent) is NOT
  // overcapacity.
  verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appA))); // queueB
  verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appB))); // queueC
  verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appC))); // queueE
  verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appE))); // queueH
  verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appF))); // queueI
}