AwexPromise implements ResolvablePromise<Result, Progress> { @Override public Promise<Result, Progress> or(Promise<Result, Progress> promise) { return new OrPromise<>(mAwex, this, promise); } AwexPromise(Awex awex);  AwexPromise(Awex awex, Task task); @SuppressWarnings("unchecked") Promise<Result, Progress> resolve(Result result); @SuppressWarnings("unchecked") Promise<Result, Progress> reject(Exception ex); @SuppressWarnings("unchecked") void notifyProgress(Progress progress); @Override void cancelTask(); @SuppressWarnings("unchecked") @Override void cancelTask(final boolean mayInterrupt); @Override int getState(); @Override boolean isPending(); @Override boolean isResolved(); @Override boolean isRejected(); @Override boolean isCancelled(); @Override boolean isCompleted(); @Override Result getResult(); @Override Result getResultOrDefault(Result defaultValue); @Override Promise<Result, Progress> done(final DoneCallback<Result> callback); @Override Promise<Result, Progress> fail(final FailCallback callback); @Override Promise<Result, Progress> progress(final ProgressCallback<Progress> callback); @Override Promise<Result, Progress> cancel(final CancelCallback callback); @Override Promise<Result, Progress> always(final AlwaysCallback callback); @Override Promise<R, P> then(final ThenCallback<Result, R, P> callback); @Override Promise<Result, Progress> or(Promise<Result, Progress> promise); @Override Promise<Collection<Result>, Progress> and(Promise<Result, Progress> promise); @Override Promise<Result, Progress> pipe(final Promise<Result, Progress> promise); @Override Promise<U, Progress> mapSingle(Mapper<Result, U> mapper); @Override Promise<Result, Progress> filterSingle(Filter<Result> filter); @Override CollectionPromise<R, Progress> stream();  }
@Test public void shouldCreateOrPromise() { setUpAwex(); mPromise = new AwexPromise<>(mAwex, mTask); Promise<Integer, Float> anyOfPromise = mPromise.or(new AwexPromise<Integer, Float>(mAwex, mTask)); assertThat(anyOfPromise, instanceOf(OrPromise.class)); }