// Path: mug/src/main/java/com/google/mu/util/Selection.java
// @SuppressWarnings("unchecked")
// static <T> Selection<T> all() {
//   return (Selection<T>) Selections.ALL;
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Selection<T> nonEmptyOrAll(Collection<? extends T> choices) {
//   return choices.isEmpty() ? all() : choices.stream().collect(toSelection());
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// @SuppressWarnings("unchecked")
// static <T> Selection<T> none() {
//   return (Selection<T>) Selections.NONE;
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// @SafeVarargs
// static <T> Selection<T> only(T... choices) {
//   return Arrays.stream(choices).collect(toSelection());
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Collector<Selection<T>, ?, Selection<T>> toIntersection() {
//   return reducing(all(), Selection::intersect);
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Collector<T, ?, Selection<T>> toSelection() {
//   return collectingAndThen(toImmutableSet(), Selections::explicit);
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Collector<Selection<T>, ?, Selection<T>> toUnion() {
//   return reducing(none(), Selection::union);
// }


import org.junit.runners.JUnit4;
import com.google.common.collect.ImmutableSet;
import com.google.common.testing.EqualsTester;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;
import static com.google.mu.util.Selection.all;
import static com.google.mu.util.Selection.nonEmptyOrAll;
import static com.google.mu.util.Selection.none;
import static com.google.mu.util.Selection.only;
import static com.google.mu.util.Selection.toIntersection;
import static com.google.mu.util.Selection.toSelection;
import static com.google.mu.util.Selection.toUnion;
import static java.util.Arrays.asList;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.stream.Stream;
import org.junit.Test;
import org.junit.runner.RunWith;
/*****************************************************************************
 * ------------------------------------------------------------------------- *
 * 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.mu.util;





@RunWith(JUnit4.class)
public class SelectionTest {

  @Test public void all_limit() {
    assertThat(all().limited()).isEmpty();
  }

  @Test public void all_has() {
    assertThat(all().has("foo")).isTrue();
    assertThat(all().has(null)).isTrue();
  }

  @Test public void all_isEmpty() {
    assertThat(all().isEmpty()).isFalse();
  }

  @Test public void none_limit() {
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// @SuppressWarnings("unchecked")
// static <T> Selection<T> all() {
//   return (Selection<T>) Selections.ALL;
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Selection<T> nonEmptyOrAll(Collection<? extends T> choices) {
//   return choices.isEmpty() ? all() : choices.stream().collect(toSelection());
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// @SuppressWarnings("unchecked")
// static <T> Selection<T> none() {
//   return (Selection<T>) Selections.NONE;
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// @SafeVarargs
// static <T> Selection<T> only(T... choices) {
//   return Arrays.stream(choices).collect(toSelection());
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Collector<Selection<T>, ?, Selection<T>> toIntersection() {
//   return reducing(all(), Selection::intersect);
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Collector<T, ?, Selection<T>> toSelection() {
//   return collectingAndThen(toImmutableSet(), Selections::explicit);
// }
// 
// Path: mug/src/main/java/com/google/mu/util/Selection.java
// static <T> Collector<Selection<T>, ?, Selection<T>> toUnion() {
//   return reducing(none(), Selection::union);
// }


// Path: mug/src/test/java/com/google/mu/util/SelectionTest.java
import org.junit.runners.JUnit4;
import com.google.common.collect.ImmutableSet;
import com.google.common.testing.EqualsTester;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;
import static com.google.mu.util.Selection.all;
import static com.google.mu.util.Selection.nonEmptyOrAll;
import static com.google.mu.util.Selection.none;
import static com.google.mu.util.Selection.only;
import static com.google.mu.util.Selection.toIntersection;
import static com.google.mu.util.Selection.toSelection;
import static com.google.mu.util.Selection.toUnion;
import static java.util.Arrays.asList;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.stream.Stream;
import org.junit.Test;
import org.junit.runner.RunWith;

/*****************************************************************************
 * ------------------------------------------------------------------------- *
 * 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.mu.util;





@RunWith(JUnit4.class)
public class SelectionTest {

  @Test public void all_limit() {
    assertThat(all().limited()).isEmpty();
  }

  @Test public void all_has() {
    assertThat(all().has("foo")).isTrue();
    assertThat(all().has(null)).isTrue();
  }

  @Test public void all_isEmpty() {
    assertThat(all().isEmpty()).isFalse();
  }

  @Test public void none_limit() {
    assertThat(none().limited()).hasValue(ImmutableSet.of());