@@ -0,0 +1,2165 @@
+/*%0A * Copyright 2014 Victor Nazarov %3Casviraspossible@gmail.com%3E.%0A */%0Apackage com.github.sviperll.concurrent;%0A%0Aimport java.util.concurrent.CancellationException;%0Aimport java.util.concurrent.ExecutionException;%0Aimport java.util.concurrent.Future;%0Aimport java.util.concurrent.TimeUnit;%0Aimport java.util.concurrent.TimeoutException;%0A%0A/**%0A *%0A * @author Victor Nazarov %3Casviraspossible@gmail.com%3E%0A */%0Apublic class SimpleFuture%3CV%3E implements Future%3CV%3E %7B%0A    private final Object lock = new Object();%0A    private V value = null;%0A    private boolean isCancelled = false;%0A    private boolean isDone = false;%0A%0A    public void set(V value) %7B%0A        synchronized(lock) %7B%0A            if (isDone %7C%7C isCancelled)%0A                throw new IllegalStateException(%22SimpleFuture already set%22);%0A            this.value = value;%0A            isDone = true;%0A            lock.notifyAll();%0A        %7D%0A    %7D%0A    %0A    @Override%0A    public boolean cancel(boolean mayInterruptIfRunning) %7B%0A        boolean wasCancelled;%0A        synchronized(lock) %7B%0A            wasCancelled = isCancelled;%0A            isCancelled = true;%0A            lock.notifyAll();%0A        %7D%0A        return wasCancelled;%0A    %7D%0A%0A    @Override%0A    public boolean isCancelled() %7B%0A        synchronized(lock) %7B%0A            return isCancelled;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public boolean isDone() %7B%0A        synchronized(lock) %7B%0A            return isDone;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public V get() throws InterruptedException, ExecutionException %7B%0A        synchronized(lock) %7B%0A            while (!isDone && !isCancelled)%0A                lock.wait();%0A            if (isCancelled)%0A                throw new CancellationException();%0A            return value;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException %7B%0A        synchronized(lock) %7B%0A            while (!isDone && !isCancelled)%0A                lock.wait(unit.toMillis(timeout));%0A            if (isCancelled)%0A                throw new CancellationException();%0A            if (!isDone)%0A                throw new TimeoutException();%0A            return value;%0A        %7D%0A    %7D%0A%0A%7D%0A

Add SimpleFuture implementation of Future interface