@Test
public void testMergeSubtract() throws PlanningException {

  TreeMap<Long, Resource> a = new TreeMap<>();
  TreeMap<Long, Resource> b = new TreeMap<>();
  setupArrays(a, b);
  RLESparseResourceAllocation rleA =
      new RLESparseResourceAllocation(a, new DefaultResourceCalculator());
  RLESparseResourceAllocation rleB =
      new RLESparseResourceAllocation(b, new DefaultResourceCalculator());
  RLESparseResourceAllocation out =
      RLESparseResourceAllocation.merge(new DefaultResourceCalculator(),
          Resource.newInstance(100 * 128 * 1024, 100 * 32), rleA, rleB,
          RLEOperator.subtract, 0, 60);
  System.out.println(out);
  long[] time = { 10, 11, 20, 22, 30, 33, 43, 50, 60 };
  int[] alloc = { 5, 0, 5, 0, 5, 0, 10, -10 };
  validate(out, time, alloc);
}