Java simple promise/deferred implementation