// 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;
/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.agera;



public final class ResultTest {
  @SuppressWarnings("ThrowableInstanceNeverThrown")
  private static final Throwable THROWABLE = new Throwable();
  private static final int VALUE = 42;
  private static final String STRING_VALUE = "stringvalue";
  private static final int OTHER_VALUE = 1;
  private static final float FLOAT_VALUE = 2;
  private static final Result<Integer> SUCCESS_WITH_VALUE = success(VALUE);
  private static final Result<Integer> SUCCESS_WITH_OTHER_VALUE = success(OTHER_VALUE);
  private static final Result<Float> SUCCESS_WITH_FLOAT_VALUE = success(FLOAT_VALUE);
  private static final Result<Integer> FAILURE_WITH_THROWABLE = failure(THROWABLE);
  private static final Result<Integer> FAILURE = failure();
// 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;

/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.agera;



public final class ResultTest {
  @SuppressWarnings("ThrowableInstanceNeverThrown")
  private static final Throwable THROWABLE = new Throwable();
  private static final int VALUE = 42;
  private static final String STRING_VALUE = "stringvalue";
  private static final int OTHER_VALUE = 1;
  private static final float FLOAT_VALUE = 2;
  private static final Result<Integer> SUCCESS_WITH_VALUE = success(VALUE);
  private static final Result<Integer> SUCCESS_WITH_OTHER_VALUE = success(OTHER_VALUE);
  private static final Result<Float> SUCCESS_WITH_FLOAT_VALUE = success(FLOAT_VALUE);
  private static final Result<Integer> FAILURE_WITH_THROWABLE = failure(THROWABLE);
  private static final Result<Integer> FAILURE = failure();
  private static final Result<Integer> PRESENT_WITH_VALUE = present(VALUE);