Question: Let's say i have ArrayList of 10 cars and i want to remove car at index 6 from my list. How should my removeCar function looks like if my existing code is:

```
public class Main {

    public static void main(String[] args) {

        Car C1 = new Car();
        C1.addCar("audi", 5);
        C1.addCar("porsche", 3);

        C1.removeCar("audi"); // is not working

}

public class Car {

    private String name;
    private int age;

    private ArrayList<Car> cars;

    public Car() {
        this.cars = new ArrayList<>();
    }

    public Car(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void addCar(String name, int age) {
        this.cars.add(new Car(name, age));
    }

    public void removeCar(String name) {
        this.cars.remove(name);
    }

      public ArrayList<Car> getCars() {
        return cars;
    }
}

```

How to change remove method to be able to remove cars from ArrayList by their name?

Answer: 
Consider using `ScheduledExecutorService`, for instance `scheduleWithFixedDelay()`. You can put the logic executed by the current `Future` to the `Runnable`. If you don't needed any delay, you can set it to 0. From implementations I'd suggest to consider first the [`ScheduledThreadPoolExecutor`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ScheduledThreadPoolExecutor.html). If you want, you can override `shutdown()` and implement the desired shuddown logic.
Thanks to mentallurg who provided a hint, I have developed the following solution

```
public class CombinedOperationsBuilder {
    public static <T> CompletableFuture<Void> transformToCycled(Supplier<CompletableFuture<T>> op)
    {
        return CompletableFuture.runAsync(() -> {
            for (;;) {
                try {
                    op.get().get();
                }catch (ExecutionException|InterruptedException e) {
                }
            }
        });
    }
}

```