@Override
  public List<SchedulingAction> schedule(
      ClusterSnapshot snapshot, EnvironmentDescription environment) {
    // Naively only run a Task on the first ContainerInstance in the snapshot:
    ContainerInstance instance =
        snapshot
            .getInstances()
            .stream()
            .sorted(Comparator.comparing(ContainerInstance::getArn))
            .findFirst()
            .get();

    boolean hasTaskAlready =
        snapshot
            .getTasks()
            .stream()
            .anyMatch(
                task ->
                    task.getContainerInstanceArn().equals(instance.getArn())
                        && task.getGroup().equals(environment.getEnvironmentName()));

    if (!hasTaskAlready) {
      return Arrays.asList(
          StartTask.builder()
              .clusterName(snapshot.getClusterName())
              .taskDefinitionArn(environment.getTaskDefinitionArn())
              .group(environment.getEnvironmentName())
              .containerInstanceArn(instance.getArn())
              .build());
    } else {
      return Collections.emptyList();
    }
  }
Temporary scheduler implementation that just starts a single task on the first instance in the
snapshot.

<p>TODO Remove this, it's only a demo scheduler
scheduling-manager/src/main/java/com/amazonaws/blox/scheduling/scheduler/engine/SingleTaskScheduler.java