Result { @NonNull public static <T> Result<T> success(@NonNull final T value) { return new Result<>(checkNotNull(value), null); } Result(@Nullable final T value, @Nullable final Throwable failure); @NonNull static Result<T> success(@NonNull final T value); @NonNull static Result<T> failure(@NonNull final Throwable failure); @SuppressWarnings("unchecked") @NonNull static Result<T> failure(); @NonNull static Result<T> present(@NonNull final T value); @SuppressWarnings("unchecked") @NonNull static Result<T> absent(); @NonNull static Result<T> absentIfNull(@Nullable final T value); boolean succeeded(); boolean failed(); boolean isPresent(); boolean isAbsent(); @NonNull T get(); @NonNull List<T> asList(); @NonNull Throwable getFailure(); @Nullable T orNull(); @Nullable Throwable failureOrNull(); @NonNull Result<T> ifSucceededSendTo(@NonNull final Receiver<? super T> receiver); @NonNull Result<T> ifFailedSendTo(@NonNull final Receiver<? super Throwable> receiver); @NonNull Result<T> ifAbsentFailureSendTo(@NonNull final Receiver<? super Throwable> receiver); @NonNull Result<T> ifNonAbsentFailureSendTo(@NonNull final Receiver<? super Throwable> receiver); @NonNull Result<T> ifSucceededBind(@NonNull final U bindValue,
      @NonNull final Binder<? super T, ? super U> binder); @NonNull Result<T> ifFailedBind(@NonNull final U bindValue,
      @NonNull final Binder<Throwable, ? super U> binder); @NonNull Result<T> ifAbsentFailureBind(@NonNull final U bindValue,
      @NonNull final Binder<Throwable, ? super U> binder); @NonNull Result<T> ifNonAbsentFailureBind(@NonNull final U bindValue,
      @NonNull final Binder<Throwable, ? super U> binder); @NonNull Result<T> ifSucceededBindFrom(@NonNull final Supplier<U> supplier,
      @NonNull final Binder<? super T, ? super U> binder); @NonNull Result<T> ifFailedBindFrom(@NonNull final Supplier<U> supplier,
      @NonNull final Binder<Throwable, ? super U> binder); @NonNull Result<T> ifAbsentFailureBindFrom(@NonNull final Supplier<U> supplier,
      @NonNull final Binder<Throwable, ? super U> binder); @NonNull Result<T> ifNonAbsentFailureBindFrom(@NonNull final Supplier<U> supplier,
      @NonNull final Binder<Throwable, ? super U> binder); @SuppressWarnings("unchecked") @NonNull Result<U> sameFailure(); @NonNull Result<U> ifSucceededMap(@NonNull final Function<? super T, U> function); @NonNull Result<U> ifSucceededAttemptMap(
      @NonNull final Function<? super T, Result<U>> attemptFunction); @NonNull Result<V> ifSucceededMerge(@NonNull final U mergeValue,
      @NonNull final Merger<? super T, ? super U, V> merger); @NonNull Result<V> ifSucceededAttemptMerge(@NonNull final U mergeValue,
      @NonNull final Merger<? super T, ? super U, Result<V>> attemptMerger); @NonNull Result<V> ifSucceededMergeFrom(@NonNull final Supplier<U> mergeValueSupplier,
      @NonNull final Merger<? super T, ? super U, V> merger); @NonNull Result<V> ifSucceededAttemptMergeFrom(
      @NonNull final Supplier<U> mergeValueSupplier,
      @NonNull final Merger<? super T, ? super U, Result<V>> attemptMerger); @NonNull T orElse(@NonNull final T other); @NonNull T orGetFrom(@NonNull final Supplier<? extends T> supplier); @SuppressWarnings("unchecked") @NonNull Result<T> orAttemptGetFrom(
      @NonNull final Supplier<? extends Result<? extends T>> supplier); @SuppressWarnings("ConstantConditions") @NonNull T recover(@NonNull final Function<? super Throwable, ? extends T> recoverFunction); @SuppressWarnings({"ConstantConditions", "unchecked"}) @NonNull Result<T> attemptRecover(
      @NonNull final Function<? super Throwable, ? extends Result<? extends T>>
          attemptRecoverFunction); boolean contains(@NonNull final T value); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldBeEqualForSameValue() { assertThat(SUCCESS_WITH_VALUE, equalTo(success(VALUE))); }