### Question:
CassandraScheduler implements Scheduler { @Override public void resourceOffers(final SchedulerDriver driver, final List<Offer> offers) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("> resourceOffers(driver : {}, offers : {})", driver, protoToString(offers)); } for (final Offer offer : offers) { final Marker marker = MarkerFactory.getMarker("offerId:" + offer.getId().getValue() + ",hostname:" + offer.getHostname()); final boolean offerUsed = evaluateOffer(driver, marker, offer); if (!offerUsed) { LOGGER.trace(marker, "Declining Offer: {}", offer.getId().getValue()); driver.declineOffer(offer.getId()); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("< resourceOffers(driver : {}, offers : {})", driver, protoToString(offers)); } } CassandraScheduler(
        @NotNull final PersistedCassandraFrameworkConfiguration configuration,
        @NotNull final CassandraCluster cassandraCluster,
        @NotNull final Clock clock
    ); @Override void registered(final SchedulerDriver driver, final FrameworkID frameworkId, final MasterInfo masterInfo); @Override void reregistered(final SchedulerDriver driver, final MasterInfo masterInfo); @Override void resourceOffers(final SchedulerDriver driver, final List<Offer> offers); @Override void offerRescinded(final SchedulerDriver driver, final OfferID offerId); @Override void statusUpdate(final SchedulerDriver driver, final TaskStatus status); @Override void frameworkMessage(final SchedulerDriver driver, final ExecutorID executorId, final SlaveID slaveId, final byte[] data); @Override void disconnected(final SchedulerDriver driver); @Override void slaveLost(final SchedulerDriver driver, final SlaveID slaveId); @Override void executorLost(final SchedulerDriver driver, final ExecutorID executorId, final SlaveID slaveId, final int status); @Override void error(final SchedulerDriver driver, final String message); @NotNull static String getTaskName(@Nullable final String taskName, @NotNull final String taskIdValue);  }### Answer:
@Test public void testResourceOffers_canHandleOffersWithMixedRoles() throws InvalidProtocolBufferException { cleanState("someOtherRole"); Protos.Offer offer = createOffer(slaves[0]); scheduler.resourceOffers(driver, newArrayList(offer)); Collection<Protos.TaskInfo> launchedTasks = driver.launchTasks()._2; assertThat(launchedTasks).isNotEmpty(); Protos.TaskInfo launchedTask = launchedTasks.iterator().next(); List<Protos.Resource> resources = launchedTask.getResourcesList(); ImmutableListMultimap<String, Protos.Resource> resourceMap = FluentIterable.from(resources) .index(resourceByName()); Protos.Resource cpus = resourceMap.get("cpus").get(0); assertThat(cpus.getRole()).isEqualTo("*"); assertThat(cpus.getScalar().getValue()).isEqualTo(0.1); Protos.Resource mem = resourceMap.get("mem").get(0); assertThat(mem.getRole()).isEqualTo("*"); assertThat(mem.getScalar().getValue()).isEqualTo(32.0); }