### Question:
SchedulerUtils { public static boolean supervisorExists(String frameworkName, String offerHost, Collection<SupervisorDetails> existingSupervisors, String topologyId) { String expectedSupervisorId = MesosCommon.supervisorId(frameworkName, offerHost, topologyId); for (SupervisorDetails supervisorDetail : existingSupervisors) { if (supervisorDetail.getId().equals(expectedSupervisorId)) { return true; } } return false; }  static List<RangeResourceEntry> getPorts(AggregatedOffers aggregatedOffers, int requiredCount); static MesosWorkerSlot createMesosWorkerSlot(Map mesosStormConf,
                                               AggregatedOffers aggregatedOffers,
                                               TopologyDetails topologyDetails,
                                               boolean supervisorExists); static boolean supervisorExists(String frameworkName, String offerHost, Collection<SupervisorDetails> existingSupervisors,
                                   String topologyId);  }### Answer:
@Test public void testSupervisorExists() throws Exception { Collection<SupervisorDetails> existingSupervisors = new ArrayList<>(); String hostName = "host1.east"; String frameworkName = "Storm!!!"; existingSupervisors.add(new SupervisorDetails(MesosCommon.supervisorId(frameworkName, hostName, "test-topology1-65-1442255385"), hostName)); existingSupervisors.add(new SupervisorDetails(MesosCommon.supervisorId(frameworkName, hostName, "test-topology10-65-1442255385"), hostName)); assertEquals(true, SchedulerUtils.supervisorExists(frameworkName, hostName, existingSupervisors, "test-topology1-65-1442255385")); assertEquals(false, SchedulerUtils.supervisorExists(frameworkName, hostName, existingSupervisors, "test-topology2-65-1442255385")); }