InMemoryReservationAllocation implements ReservationAllocation { @Override public boolean containsGangs() { return hasGang; } InMemoryReservationAllocation(ReservationId reservationID,
      ReservationDefinition contract, String user, String planName,
      long startTime, long endTime,
      Map<ReservationInterval, Resource> allocations,
      ResourceCalculator calculator, Resource minAlloc);  InMemoryReservationAllocation(ReservationId reservationID,
      ReservationDefinition contract, String user, String planName,
      long startTime, long endTime,
      Map<ReservationInterval, Resource> allocations,
      ResourceCalculator calculator, Resource minAlloc, boolean hasGang); @Override ReservationId getReservationId(); @Override ReservationDefinition getReservationDefinition(); @Override long getStartTime(); @Override long getEndTime(); @Override Map<ReservationInterval, Resource> getAllocationRequests(); @Override String getPlanName(); @Override String getUser(); @Override boolean containsGangs(); @Override void setAcceptanceTimestamp(long acceptedAt); @Override long getAcceptanceTime(); @Override Resource getResourcesAtTime(long tick); @Override RLESparseResourceAllocation getResourcesOverTime(); @Override String toString(); @Override int compareTo(ReservationAllocation other); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testZeroAlloaction() { ReservationId reservationID = ReservationId.newInstance(rand.nextLong(), rand.nextLong()); int[] alloc = {}; long start = 0; ReservationDefinition rDef = ReservationSystemTestUtil.createSimpleReservationDefinition( start, start + alloc.length + 1, alloc.length); Map<ReservationInterval, Resource> allocations = new HashMap<ReservationInterval, Resource>(); ReservationAllocation rAllocation = new InMemoryReservationAllocation(reservationID, rDef, user, planName, start, start + alloc.length + 1, allocations, resCalc, minAlloc); doAssertions(rAllocation, reservationID, rDef, allocations, (int) start, alloc); Assert.assertFalse(rAllocation.containsGangs()); }