Resources { public Resources filter(Predicate<Resource> predicate) { return new Resources(Iterables.filter(mesosResources, predicate)); } private  Resources(Iterable<Resource> mesosResources); static Resources from(Offer offer); Resources filter(Predicate<Resource> predicate); Resources filter(TierInfo tierInfo); ResourceSlot slot(); Set<Integer> getPorts(int numPorts); static final Predicate<Resource> REVOCABLE; static final Predicate<Resource> NON_REVOCABLE; static final Function<Range, Set<Integer>> RANGE_TO_MEMBERS; }
@Test public void testFilter() { ImmutableList<Resource> resources = ImmutableList.<Resource>builder() .add(makeMesosResource(CPUS, 8.0, true)) .add(makeMesosResource(RAM_MB, 1024, false)) .build(); assertEquals( new ResourceSlot(8.0, Amount.of(1024L, MB), Amount.of(0L, MB), 0), Resources.from(createOffer(resources)).filter(Resources.REVOCABLE).slot()); }