public static List<ReservationAllocationState>
        convertAllocationsToReservationInfo(Set<ReservationAllocation> res,
                        boolean includeResourceAllocations) {
    List<ReservationAllocationState> reservationInfo = new ArrayList<>();

    Map<ReservationInterval, Resource> requests;
    for (ReservationAllocation allocation : res) {
      List<ResourceAllocationRequest> allocations = new ArrayList<>();
      if (includeResourceAllocations) {
        requests = allocation.getAllocationRequests();

        for (Map.Entry<ReservationInterval, Resource> request :
                requests.entrySet()) {
          ReservationInterval interval = request.getKey();
          allocations.add(ResourceAllocationRequest.newInstance(
                  interval.getStartTime(), interval.getEndTime(),
                  request.getValue()));
        }
      }

      reservationInfo.add(ReservationAllocationState.newInstance(
              allocation.getAcceptanceTime(), allocation.getUser(),
              allocations, allocation.getReservationId(),
              allocation.getReservationDefinition()));
    }
    return reservationInfo;
  }
@Test
  public void testConvertAllocationsToReservationInfoEmptySet() {
    List<ReservationAllocationState> infoList = ReservationSystemUtil
            .convertAllocationsToReservationInfo(
                    Collections.<ReservationAllocation>emptySet(), false);

    assertThat(infoList).isEmpty();
  }