SegmentRunner implements RepairStatusHandler, Runnable { static boolean okToRepairSegment( boolean allHostsChecked, boolean allLocalDcHostsChecked, DatacenterAvailability dcAvailability) { return allHostsChecked || (allLocalDcHostsChecked && DatacenterAvailability.LOCAL == dcAvailability); } private  SegmentRunner(
      AppContext context,
      ClusterFacade clusterFacade,
      UUID segmentId,
      Collection<String> potentialCoordinators,
      long timeoutMillis,
      double intensity,
      RepairParallelism validationParallelism,
      String clusterName,
      RepairUnit repairUnit,
      Set<String> tablesToRepair,
      RepairRunner repairRunner); static SegmentRunner create(
      AppContext context,
      ClusterFacade clusterFacade,
      UUID segmentId,
      Collection<String> potentialCoordinators,
      long timeoutMillis,
      double intensity,
      RepairParallelism validationParallelism,
      String clusterName,
      RepairUnit repairUnit,
      Set<String> tablesToRepair,
      RepairRunner repairRunner); @Override void run(); @Override void handle(
      int repairNo,
      Optional<ActiveRepairService.Status> status,
      Optional<ProgressEventType> progress,
      String message,
      JmxProxy jmxProxy);  }
@Test public void isItOkToRepairTest() { assertFalse(SegmentRunner.okToRepairSegment(false, true, DatacenterAvailability.ALL)); assertFalse(SegmentRunner.okToRepairSegment(false, false, DatacenterAvailability.ALL)); assertTrue(SegmentRunner.okToRepairSegment(true, true, DatacenterAvailability.ALL)); assertTrue(SegmentRunner.okToRepairSegment(false, true, DatacenterAvailability.LOCAL)); assertFalse(SegmentRunner.okToRepairSegment(false, false, DatacenterAvailability.LOCAL)); assertTrue(SegmentRunner.okToRepairSegment(true, true, DatacenterAvailability.LOCAL)); assertFalse(SegmentRunner.okToRepairSegment(false, true, DatacenterAvailability.EACH)); assertFalse(SegmentRunner.okToRepairSegment(false, false, DatacenterAvailability.EACH)); assertTrue(SegmentRunner.okToRepairSegment(true, true, DatacenterAvailability.EACH)); }