ResourceSlot { public static ResourceSlot sum(Iterable<ResourceSlot> slots) { ResourceSlot sum = NONE; for (ResourceSlot r : slots) { sum = sum.add(r); } return sum; } ResourceSlot(
      double numCpus,
      Amount<Long, Data> ram,
      Amount<Long, Data> disk,
      int numPorts); static ResourceSlot from(ITaskConfig task); static TaskInfo matchResourceTypes(TaskInfo task); List<Protos.Resource> toResourceList(TierInfo tierInfo); @VisibleForTesting static Protos.Resource makeMesosRangeResource(
      ResourceType resourceType,
      Set<Integer> values); double getNumCpus(); Amount<Long, Data> getDisk(); Amount<Long, Data> getRam(); int getNumPorts(); @Override boolean equals(Object o); @Override int hashCode(); static ResourceSlot sum(Iterable<ResourceSlot> slots); ResourceSlot add(ResourceSlot other); ResourceSlot subtract(ResourceSlot other); static final ResourceSlot NONE; static final Function<Range<Integer>, Protos.Value.Range> RANGE_TRANSFORM; static final Ordering<ResourceSlot> ORDER; }
@Test public void testSum() { assertEquals(THREE, sum(ImmutableList.of(ONE, ONE, ONE))); }