// if a duration was defined, then schedule a future task to kill the blinker task
if (duration > 0) {
// create future job to stop blinking
ScheduledFuture<?> scheduledFutureBlinkStopTask = scheduledExecutorService
.schedule(new GpioBlinkStopTaskImpl(pin,PinState.getInverseState(blinkState), scheduledFutureBlinkTask), duration, TimeUnit.MILLISECONDS);
// add the new scheduled stop task to the tasks collection
tasks.add(scheduledFutureBlinkStopTask);
// create future task to clean up completed tasks