public Resource getMinimumCapacityInInterval(ReservationInterval interval) {
    Resource minCapacity =
        Resource.newInstance(Integer.MAX_VALUE, Integer.MAX_VALUE);
    long start = interval.getStartTime();
    long end = interval.getEndTime();
    NavigableMap<Long, Resource> capacityRange =
        getRangeOverlapping(start, end).getCumulative();
    if (!capacityRange.isEmpty()) {
      for (Map.Entry<Long, Resource> entry : capacityRange.entrySet()) {
        if (entry.getValue() != null) {
          minCapacity =
              Resources.componentwiseMin(minCapacity, entry.getValue());
        }
      }
    }
    return minCapacity;
  }
@Test
  public void testGetMinimumCapacityInInterval() {
    long[] timeSteps = { 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L };
    int[] alloc = { 2, 5, 7, 10, 3, 4, 0, 8 };
    RLESparseResourceAllocation rleSparseVector = ReservationSystemTestUtil
        .generateRLESparseResourceAllocation(alloc, timeSteps);
    LOG.info(rleSparseVector.toString());
    Assert.assertEquals(rleSparseVector.getMinimumCapacityInInterval(
        new ReservationInterval(1L, 3L)), Resource.newInstance(5, 5));
    Assert.assertEquals(rleSparseVector.getMinimumCapacityInInterval(
        new ReservationInterval(2L, 5L)), Resource.newInstance(3, 3));
    Assert.assertEquals(rleSparseVector.getMinimumCapacityInInterval(
        new ReservationInterval(1L, 7L)), Resource.newInstance(0, 0));
  }