class PollerUtil {

    public List<CloudVmInstanceStatus> waitFor(AuthenticatedContext authenticatedContext, List<CloudInstance> instances,
            Set<InstanceStatus> completedStatuses) {
        return Polling.stopAfterAttempt(pollingAttempt)
                .waitPeriodly(pollingInterval, TimeUnit.SECONDS)
                .stopIfException(true)
                .run(process(authenticatedContext, instances, completedStatuses));
    }

}