code: static long getTotalSize(Collection<Allocation> allocations) {
      long totalSize = 0;
      for (Allocation allocation : allocations) {
        totalSize += allocation.size;
      }
      return totalSize;
    }
docs: Returns the sum of the {@link #size sizes} of the allocations.