// Path: agera/src/main/java/com/google/android/agera/Result.java
// @SuppressWarnings("unchecked")
// @NonNull
// public static <T> Result<T> absent() {
//   return (Result<T>) ABSENT;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> absentIfNull(@Nullable final T value) {
//   return value == null ? Result.<T>absent() : present(value);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> failure(@NonNull final Throwable failure) {
//   return failure == ABSENT_THROWABLE
//       ? Result.<T>absent() : new Result<T>(null, checkNotNull(failure));
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> present(@NonNull final T value) {
//   return success(value);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> success(@NonNull final T value) {
//   return new Result<>(checkNotNull(value), null);
// }


import static com.google.android.agera.Result.absent;
import static com.google.android.agera.Result.absentIfNull;
import static com.google.android.agera.Result.failure;
import static com.google.android.agera.Result.present;
import static com.google.android.agera.Result.success;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasToString;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.sameInstance;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import nl.jqno.equalsverifier.EqualsVerifier;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
  @Test
  public void shouldApplyBindIfSucceeded() {
    SUCCESS_WITH_VALUE.ifSucceededBind(STRING_VALUE, mockBinder);

    verify(mockBinder).bind(VALUE, STRING_VALUE);
  }

  @Test
  public void shouldNotApplyBindIfFailed() {
    FAILURE_WITH_THROWABLE.ifSucceededBind(STRING_VALUE, mockBinder);

    verifyZeroInteractions(mockSupplier);
    verifyZeroInteractions(mockBinder);
  }

  @Test
  public void shouldApplyBindFromIfSucceeded() {
    SUCCESS_WITH_VALUE.ifSucceededBindFrom(mockSupplier, mockBinder);

    verify(mockBinder).bind(VALUE, STRING_VALUE);
  }

  @Test
  public void shouldNotApplyBindFromIfFailed() {
    FAILURE_WITH_THROWABLE.ifSucceededBindFrom(mockSupplier, mockBinder);

    verifyZeroInteractions(mockSupplier);
    verifyZeroInteractions(mockBinder);
  }

// Path: agera/src/main/java/com/google/android/agera/Result.java
// @SuppressWarnings("unchecked")
// @NonNull
// public static <T> Result<T> absent() {
//   return (Result<T>) ABSENT;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> absentIfNull(@Nullable final T value) {
//   return value == null ? Result.<T>absent() : present(value);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> failure(@NonNull final Throwable failure) {
//   return failure == ABSENT_THROWABLE
//       ? Result.<T>absent() : new Result<T>(null, checkNotNull(failure));
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> present(@NonNull final T value) {
//   return success(value);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Result.java
// @NonNull
// public static <T> Result<T> success(@NonNull final T value) {
//   return new Result<>(checkNotNull(value), null);
// }


// Path: agera/src/test/java/com/google/android/agera/ResultTest.java
import static com.google.android.agera.Result.absent;
import static com.google.android.agera.Result.absentIfNull;
import static com.google.android.agera.Result.failure;
import static com.google.android.agera.Result.present;
import static com.google.android.agera.Result.success;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasToString;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.sameInstance;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import nl.jqno.equalsverifier.EqualsVerifier;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

  @Test
  public void shouldApplyBindIfSucceeded() {
    SUCCESS_WITH_VALUE.ifSucceededBind(STRING_VALUE, mockBinder);

    verify(mockBinder).bind(VALUE, STRING_VALUE);
  }

  @Test
  public void shouldNotApplyBindIfFailed() {
    FAILURE_WITH_THROWABLE.ifSucceededBind(STRING_VALUE, mockBinder);

    verifyZeroInteractions(mockSupplier);
    verifyZeroInteractions(mockBinder);
  }

  @Test
  public void shouldApplyBindFromIfSucceeded() {
    SUCCESS_WITH_VALUE.ifSucceededBindFrom(mockSupplier, mockBinder);

    verify(mockBinder).bind(VALUE, STRING_VALUE);
  }

  @Test
  public void shouldNotApplyBindFromIfFailed() {
    FAILURE_WITH_THROWABLE.ifSucceededBindFrom(mockSupplier, mockBinder);

    verifyZeroInteractions(mockSupplier);
    verifyZeroInteractions(mockBinder);
  }

  @Test