// 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 trueCondition() {
//   return TRUE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @SafeVarargs
// @NonNull
// @SuppressWarnings("unchecked")
// public static <T> Predicate<T> all(@NonNull final Predicate<? super T>... predicates) {
//   return composite(predicates, truePredicate(), falsePredicate(), false);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @SuppressWarnings("unchecked")
// @SafeVarargs
// @NonNull
// public static <T> Predicate<T> any(@NonNull final Predicate<? super T>... predicates) {
//   return composite(predicates, falsePredicate(), truePredicate(), true);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static <T> Predicate<T> conditionAsPredicate(@NonNull final Condition condition) {
//   if (condition == TRUE_CONDICATE) {
//     return truePredicate();
//   }
//   if (condition == FALSE_CONDICATE) {
//     return falsePredicate();
//   }
//   return new ConditionAsPredicate<>(condition);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static Predicate<CharSequence> emptyString() {
//   return EMPTY_STRING_PREDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static <T> Predicate<T> equalTo(@NonNull final T object) {
//   return new EqualToPredicate<>(object);
// }
// 
// 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
// public static <T> Predicate<T> instanceOf(@NonNull final Class<?> type) {
//   return new InstanceOfPredicate<>(type);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static <T> Predicate<T> not(@NonNull final Predicate<T> predicate) {
//   if (predicate instanceof NegatedPredicate) {
//     return ((NegatedPredicate<T>) predicate).predicate;
//   }
//   if (predicate == truePredicate()) {
//     return falsePredicate();
//   }
//   if (predicate == falsePredicate()) {
//     return truePredicate();
//   }
//   return new NegatedPredicate<>(predicate);
// }
// 
// 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/HasPrivateConstructor.java
// @NonNull
// @Factory
// public static Matcher<Class<?>> hasPrivateConstructor() {
//   return INSTANCE;
// }


import static com.google.android.agera.Conditions.falseCondition;
import static com.google.android.agera.Conditions.trueCondition;
import static com.google.android.agera.Predicates.all;
import static com.google.android.agera.Predicates.any;
import static com.google.android.agera.Predicates.conditionAsPredicate;
import static com.google.android.agera.Predicates.emptyString;
import static com.google.android.agera.Predicates.equalTo;
import static com.google.android.agera.Predicates.falsePredicate;
import static com.google.android.agera.Predicates.instanceOf;
import static com.google.android.agera.Predicates.not;
import static com.google.android.agera.Predicates.truePredicate;
import static com.google.android.agera.test.matchers.HasPrivateConstructor.hasPrivateConstructor;
import static com.google.android.agera.test.matchers.PredicateApply.appliesFor;
import static com.google.android.agera.test.matchers.PredicateApply.doesNotApplyFor;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;
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;
import org.mockito.Mockito;
/*
 * 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 PredicatesTest {
  private static final String ITEM = "item";
  private static final String OTHER_ITEM = "otheritem";

  @Mock
  private Predicate<Object> mockPredicateFalse;
  @Mock
  private Predicate<Object> mockPredicateTrue;
  @Mock
  private Condition mockCondition;

  @Before
  public void setUp() {
    initMocks(this);
// 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 trueCondition() {
//   return TRUE_CONDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @SafeVarargs
// @NonNull
// @SuppressWarnings("unchecked")
// public static <T> Predicate<T> all(@NonNull final Predicate<? super T>... predicates) {
//   return composite(predicates, truePredicate(), falsePredicate(), false);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @SuppressWarnings("unchecked")
// @SafeVarargs
// @NonNull
// public static <T> Predicate<T> any(@NonNull final Predicate<? super T>... predicates) {
//   return composite(predicates, falsePredicate(), truePredicate(), true);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static <T> Predicate<T> conditionAsPredicate(@NonNull final Condition condition) {
//   if (condition == TRUE_CONDICATE) {
//     return truePredicate();
//   }
//   if (condition == FALSE_CONDICATE) {
//     return falsePredicate();
//   }
//   return new ConditionAsPredicate<>(condition);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static Predicate<CharSequence> emptyString() {
//   return EMPTY_STRING_PREDICATE;
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static <T> Predicate<T> equalTo(@NonNull final T object) {
//   return new EqualToPredicate<>(object);
// }
// 
// 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
// public static <T> Predicate<T> instanceOf(@NonNull final Class<?> type) {
//   return new InstanceOfPredicate<>(type);
// }
// 
// Path: agera/src/main/java/com/google/android/agera/Predicates.java
// @NonNull
// public static <T> Predicate<T> not(@NonNull final Predicate<T> predicate) {
//   if (predicate instanceof NegatedPredicate) {
//     return ((NegatedPredicate<T>) predicate).predicate;
//   }
//   if (predicate == truePredicate()) {
//     return falsePredicate();
//   }
//   if (predicate == falsePredicate()) {
//     return truePredicate();
//   }
//   return new NegatedPredicate<>(predicate);
// }
// 
// 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/HasPrivateConstructor.java
// @NonNull
// @Factory
// public static Matcher<Class<?>> hasPrivateConstructor() {
//   return INSTANCE;
// }


// Path: agera/src/test/java/com/google/android/agera/PredicatesTest.java
import static com.google.android.agera.Conditions.falseCondition;
import static com.google.android.agera.Conditions.trueCondition;
import static com.google.android.agera.Predicates.all;
import static com.google.android.agera.Predicates.any;
import static com.google.android.agera.Predicates.conditionAsPredicate;
import static com.google.android.agera.Predicates.emptyString;
import static com.google.android.agera.Predicates.equalTo;
import static com.google.android.agera.Predicates.falsePredicate;
import static com.google.android.agera.Predicates.instanceOf;
import static com.google.android.agera.Predicates.not;
import static com.google.android.agera.Predicates.truePredicate;
import static com.google.android.agera.test.matchers.HasPrivateConstructor.hasPrivateConstructor;
import static com.google.android.agera.test.matchers.PredicateApply.appliesFor;
import static com.google.android.agera.test.matchers.PredicateApply.doesNotApplyFor;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;
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;
import org.mockito.Mockito;

/*
 * 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 PredicatesTest {
  private static final String ITEM = "item";
  private static final String OTHER_ITEM = "otheritem";

  @Mock
  private Predicate<Object> mockPredicateFalse;
  @Mock
  private Predicate<Object> mockPredicateTrue;
  @Mock
  private Condition mockCondition;

  @Before
  public void setUp() {
    initMocks(this);
    when(mockPredicateTrue.apply(Mockito.any())).thenReturn(true);