// Path: src/main/java/com/goodow/realtime/core/AsyncResult.java
// public interface AsyncResult<T> {
//   /**
//    * An exception describing failure. This will be null if the operation succeeded.
//    */
//   Throwable cause();
// 
//   /**
//    * Did it fail?
//    */
//   boolean failed();
// 
//   /**
//    * The result of the operation. This will be null if the operation failed.
//    */
//   T result();
// }
// 
// Path: src/main/java/com/goodow/realtime/core/Future.java
// public interface Future<T> extends AsyncResult<T> {
//   /**
//    * Has it completed?
//    */
//   boolean complete();
// 
//   /**
//    * Set the failure. Any handler will be called, if there is one
//    */
//   Future<T> setFailure(Throwable throwable);
// 
//   /**
//    * Set a handler for the result. It will get called when it's complete
//    */
//   Future<T> setHandler(Handler<AsyncResult<T>> handler);
// 
//   /**
//    * Set the result. Any handler will be called, if there is one
//    */
//   Future<T> setResult(T result);
// }
// 
// Path: src/main/java/com/goodow/realtime/core/Handler.java
// public interface Handler<E> {
// 
//   /**
//    * Something has happened, so handle it.
//    */
//   void handle(E event);
// }


import com.goodow.realtime.core.Future;
import com.goodow.realtime.core.Handler;
import com.goodow.realtime.core.AsyncResult;
   * Did it fail?
   */
  @Override
  public boolean failed() {
    return failed;
  }

  /**
   * The result of the operation. This will be null if the operation failed.
   */
  @Override
  public T result() {
    return result;
  }

  /**
   * Set the failure. Any handler will be called, if there is one
   */
  @Override
  public FutureResultImpl<T> setFailure(Throwable throwable) {
    this.throwable = throwable;
    failed = true;
    checkCallHandler();
    return this;
  }

  /**
   * Set a handler for the result. It will get called when it's complete
   */
  @Override
// Path: src/main/java/com/goodow/realtime/core/AsyncResult.java
// public interface AsyncResult<T> {
//   /**
//    * An exception describing failure. This will be null if the operation succeeded.
//    */
//   Throwable cause();
// 
//   /**
//    * Did it fail?
//    */
//   boolean failed();
// 
//   /**
//    * The result of the operation. This will be null if the operation failed.
//    */
//   T result();
// }
// 
// Path: src/main/java/com/goodow/realtime/core/Future.java
// public interface Future<T> extends AsyncResult<T> {
//   /**
//    * Has it completed?
//    */
//   boolean complete();
// 
//   /**
//    * Set the failure. Any handler will be called, if there is one
//    */
//   Future<T> setFailure(Throwable throwable);
// 
//   /**
//    * Set a handler for the result. It will get called when it's complete
//    */
//   Future<T> setHandler(Handler<AsyncResult<T>> handler);
// 
//   /**
//    * Set the result. Any handler will be called, if there is one
//    */
//   Future<T> setResult(T result);
// }
// 
// Path: src/main/java/com/goodow/realtime/core/Handler.java
// public interface Handler<E> {
// 
//   /**
//    * Something has happened, so handle it.
//    */
//   void handle(E event);
// }


// Path: src/main/java/com/goodow/realtime/core/impl/FutureResultImpl.java
import com.goodow.realtime.core.Future;
import com.goodow.realtime.core.Handler;
import com.goodow.realtime.core.AsyncResult;

   * Did it fail?
   */
  @Override
  public boolean failed() {
    return failed;
  }

  /**
   * The result of the operation. This will be null if the operation failed.
   */
  @Override
  public T result() {
    return result;
  }

  /**
   * Set the failure. Any handler will be called, if there is one
   */
  @Override
  public FutureResultImpl<T> setFailure(Throwable throwable) {
    this.throwable = throwable;
    failed = true;
    checkCallHandler();
    return this;
  }

  /**
   * Set a handler for the result. It will get called when it's complete
   */
  @Override
  public FutureResultImpl<T> setHandler(Handler<AsyncResult<T>> handler) {