// 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;
    assertThat(ABSENT.isPresent(), equalTo(false));
  }

  @Test
  public void shouldReturnTrueForIsPresentWithValue() {
    assertThat(PRESENT_WITH_VALUE.isPresent(), equalTo(true));
  }

  @Test
  public void shouldReturnTrueForIsAbsentOfAbsent() {
    assertThat(ABSENT.isAbsent(), equalTo(true));
  }

  @Test
  public void shouldReturnFalseForIsAbsentWithValue() {
    assertThat(PRESENT_WITH_VALUE.isAbsent(), equalTo(false));
  }

  @Test
  public void shouldReturnFalseForIsAbsentOfNonAbsentFailure() {
    assertThat(FAILURE.isAbsent(), equalTo(false));
  }

  @Test
  public void shouldReturnAbsentForFailureWithAbsentFailure() {
    assertThat(Result.<Integer>failure(ABSENT.getFailure()), sameInstance(ABSENT));
  }

  @Test
  public void shouldReturnAbsentForOfNullableWithNull() {
// 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;

    assertThat(ABSENT.isPresent(), equalTo(false));
  }

  @Test
  public void shouldReturnTrueForIsPresentWithValue() {
    assertThat(PRESENT_WITH_VALUE.isPresent(), equalTo(true));
  }

  @Test
  public void shouldReturnTrueForIsAbsentOfAbsent() {
    assertThat(ABSENT.isAbsent(), equalTo(true));
  }

  @Test
  public void shouldReturnFalseForIsAbsentWithValue() {
    assertThat(PRESENT_WITH_VALUE.isAbsent(), equalTo(false));
  }

  @Test
  public void shouldReturnFalseForIsAbsentOfNonAbsentFailure() {
    assertThat(FAILURE.isAbsent(), equalTo(false));
  }

  @Test
  public void shouldReturnAbsentForFailureWithAbsentFailure() {
    assertThat(Result.<Integer>failure(ABSENT.getFailure()), sameInstance(ABSENT));
  }

  @Test
  public void shouldReturnAbsentForOfNullableWithNull() {
    assertThat(Result.<Integer>absentIfNull(null), sameInstance(ABSENT));