// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition all(@NonNull final Condition... conditions) {
//   return composite(conditions, trueCondition(), falseCondition());
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition any(@NonNull final Condition... conditions) {
//   return composite(conditions, falseCondition(), trueCondition());
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition falseCondition() {
//   return FALSE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition not(@NonNull final Condition condition) {
//   if (condition instanceof NegatedCondition) {
//     return ((NegatedCondition) condition).condition;
//   }
//   if (condition == TRUE_CONDICATE) {
//     return FALSE_CONDICATE;
//   }
//   if (condition == FALSE_CONDICATE) {
//     return TRUE_CONDICATE;
//   }
//   return new NegatedCondition(condition);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static <T> Condition predicateAsCondition(@NonNull final Predicate<T> predicate,
//     @NonNull final Supplier<? extends T> supplier) {
//   if (predicate == TRUE_CONDICATE) {
//     return TRUE_CONDICATE;
//   }
//   if (predicate == FALSE_CONDICATE) {
//     return FALSE_CONDICATE;
//   }
//   return new PredicateCondition<>(predicate, supplier);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition staticCondition(final boolean value) {
//   return value ? TRUE_CONDICATE : FALSE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition trueCondition() {
//   return TRUE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static <T> Predicate<T> falsePredicate() {
//   return FALSE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static <T> Predicate<T> truePredicate() {
//   return TRUE_CONDICATE;
// }
// 
// Path: agera/src/test/java/com/google/android/agera/test/matchers/ConditionApplies.java
// @NonNull
// @Factory
// public static Matcher<Condition> applies() {
//   return new ConditionApplies(true);
// }
// 
// Path: agera/src/test/java/com/google/android/agera/test/matchers/ConditionApplies.java
// @NonNull
// @Factory
// public static Matcher<Condition> doesNotApply() {
//   return new ConditionApplies(false);
// }
// 
// Path: agera/src/test/java/com/google/android/agera/test/matchers/HasPrivateConstructor.java
// @NonNull
// @Factory
// public static Matcher<Class<?>> hasPrivateConstructor() {
//   return INSTANCE;
// }


import static com.google.android.agera.Conditions.all;
import static com.google.android.agera.Conditions.any;
import static com.google.android.agera.Conditions.falseCondition;
import static com.google.android.agera.Conditions.not;
import static com.google.android.agera.Conditions.predicateAsCondition;
import static com.google.android.agera.Conditions.staticCondition;
import static com.google.android.agera.Conditions.trueCondition;
import static com.google.android.agera.Predicates.falsePredicate;
import static com.google.android.agera.Predicates.truePredicate;
import static com.google.android.agera.test.matchers.ConditionApplies.applies;
import static com.google.android.agera.test.matchers.ConditionApplies.doesNotApply;
import static com.google.android.agera.test.matchers.HasPrivateConstructor.hasPrivateConstructor;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
  public void shouldReturnOriginalConditionIfNegatedTwice() {
    assertThat(not(not(mockConditionFalse)), is(sameInstance(mockConditionFalse)));
  }

  @Test
  public void shouldReturnTrueForAllWithNoConditions() {
    assertThat(all(), sameInstance(trueCondition()));
  }

  @Test
  public void shouldReturnOriginalConditionIfAllOfOne() {
    assertThat(all(mockConditionFalse), is(sameInstance(mockConditionFalse)));
  }

  @Test
  public void shouldReturnTrueForAllWithTrueConditions() {
    assertThat(all(trueCondition(), trueCondition()), sameInstance(trueCondition()));
  }

  @Test
  public void shouldReturnFalseForAllWithOneFalseCondition() {
    assertThat(all(trueCondition(), falseCondition()), sameInstance(falseCondition()));
  }

  @Test
  public void shouldReturnTrueForAllWithNonStaticTrueConditions() {
    assertThat(all(mockConditionTrue, mockConditionTrue), applies());
  }

  @Test
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition all(@NonNull final Condition... conditions) {
//   return composite(conditions, trueCondition(), falseCondition());
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition any(@NonNull final Condition... conditions) {
//   return composite(conditions, falseCondition(), trueCondition());
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition falseCondition() {
//   return FALSE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition not(@NonNull final Condition condition) {
//   if (condition instanceof NegatedCondition) {
//     return ((NegatedCondition) condition).condition;
//   }
//   if (condition == TRUE_CONDICATE) {
//     return FALSE_CONDICATE;
//   }
//   if (condition == FALSE_CONDICATE) {
//     return TRUE_CONDICATE;
//   }
//   return new NegatedCondition(condition);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static <T> Condition predicateAsCondition(@NonNull final Predicate<T> predicate,
//     @NonNull final Supplier<? extends T> supplier) {
//   if (predicate == TRUE_CONDICATE) {
//     return TRUE_CONDICATE;
//   }
//   if (predicate == FALSE_CONDICATE) {
//     return FALSE_CONDICATE;
//   }
//   return new PredicateCondition<>(predicate, supplier);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition staticCondition(final boolean value) {
//   return value ? TRUE_CONDICATE : FALSE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Conditions.java
// @NonNull
// public static Condition trueCondition() {
//   return TRUE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static <T> Predicate<T> falsePredicate() {
//   return FALSE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static <T> Predicate<T> truePredicate() {
//   return TRUE_CONDICATE;
// }
// 
// Path: agera/src/test/java/com/google/android/agera/test/matchers/ConditionApplies.java
// @NonNull
// @Factory
// public static Matcher<Condition> applies() {
//   return new ConditionApplies(true);
// }
// 
// Path: agera/src/test/java/com/google/android/agera/test/matchers/ConditionApplies.java
// @NonNull
// @Factory
// public static Matcher<Condition> doesNotApply() {
//   return new ConditionApplies(false);
// }
// 
// Path: agera/src/test/java/com/google/android/agera/test/matchers/HasPrivateConstructor.java
// @NonNull
// @Factory
// public static Matcher<Class<?>> hasPrivateConstructor() {
//   return INSTANCE;
// }


// Path: agera/src/test/java/com/google/android/agera/ConditionsTest.java
import static com.google.android.agera.Conditions.all;
import static com.google.android.agera.Conditions.any;
import static com.google.android.agera.Conditions.falseCondition;
import static com.google.android.agera.Conditions.not;
import static com.google.android.agera.Conditions.predicateAsCondition;
import static com.google.android.agera.Conditions.staticCondition;
import static com.google.android.agera.Conditions.trueCondition;
import static com.google.android.agera.Predicates.falsePredicate;
import static com.google.android.agera.Predicates.truePredicate;
import static com.google.android.agera.test.matchers.ConditionApplies.applies;
import static com.google.android.agera.test.matchers.ConditionApplies.doesNotApply;
import static com.google.android.agera.test.matchers.HasPrivateConstructor.hasPrivateConstructor;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

  public void shouldReturnOriginalConditionIfNegatedTwice() {
    assertThat(not(not(mockConditionFalse)), is(sameInstance(mockConditionFalse)));
  }

  @Test
  public void shouldReturnTrueForAllWithNoConditions() {
    assertThat(all(), sameInstance(trueCondition()));
  }

  @Test
  public void shouldReturnOriginalConditionIfAllOfOne() {
    assertThat(all(mockConditionFalse), is(sameInstance(mockConditionFalse)));
  }

  @Test
  public void shouldReturnTrueForAllWithTrueConditions() {
    assertThat(all(trueCondition(), trueCondition()), sameInstance(trueCondition()));
  }

  @Test
  public void shouldReturnFalseForAllWithOneFalseCondition() {
    assertThat(all(trueCondition(), falseCondition()), sameInstance(falseCondition()));
  }

  @Test
  public void shouldReturnTrueForAllWithNonStaticTrueConditions() {
    assertThat(all(mockConditionTrue, mockConditionTrue), applies());
  }

  @Test
  public void shouldReturnFalseForAllWithNonStaticOneFalseCondition() {