Guava Futures has a method for this