// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> L<T> l() {
//     return new L<>(new ArrayList<>());
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/V2.java
// public static <X, Y> V2<X, Y> v(X x, Y y) {
//     return new V2(x, y);
// }


import static ch.codebulb.lambdaomega.L.l;
import static ch.codebulb.lambdaomega.V2.v;
import java.util.function.Predicate;
import java.util.function.Supplier;
package ch.codebulb.lambdaomega;


/**
 * The "U" stands for "utils". Provides common static helper methods.
 */
public class U {
    private U() {}
    
    /**
     * Prints the object provided to the standard output.
     */
    public static void println(Object out) {
        System.out.println(out);
    }
    
    /**
     * Creates a {@link Choice}.
     */
    public static <T> Choice<T> Choose(boolean predicate, Supplier<T> function) {
        return new Choice<>(predicate, function);
    }
    
    /**
     * Returns <code>true</code> if the <code>predicate</code> provided is <code>true</code> for at least one of the <code>candidates</code>.
     */
    public static <T> boolean any(Predicate<T> predicate, T... candidates) {
        return C.toStream(candidates).anyMatch(predicate);
    }
    
    /**
     * Represents a simple choice tree. This structure can be used as an alternative to
     * an <code>if</code> / <code>else if</code> / <code>else</code> structure with optionally enforced choice.<p/>
     * 
     * The constructor of this class is not visible; use the convenience {@link U#Choose(boolean, Supplier)} method to create a new instance of this class.
     * It's best practice to statically import this function in client code.
     *
     * @param <T> the return type
     */
    public static class Choice<T> {
        private final L<V2<Boolean, Supplier<T>>> choices;
        
        Choice(boolean predicate, Supplier<T> function) {
// Path: src/main/java/ch/codebulb/lambdaomega/L.java
// public static <T> L<T> l() {
//     return new L<>(new ArrayList<>());
// }
// 
// Path: src/main/java/ch/codebulb/lambdaomega/V2.java
// public static <X, Y> V2<X, Y> v(X x, Y y) {
//     return new V2(x, y);
// }


// Path: src/main/java/ch/codebulb/lambdaomega/U.java
import static ch.codebulb.lambdaomega.L.l;
import static ch.codebulb.lambdaomega.V2.v;
import java.util.function.Predicate;
import java.util.function.Supplier;

package ch.codebulb.lambdaomega;


/**
 * The "U" stands for "utils". Provides common static helper methods.
 */
public class U {
    private U() {}
    
    /**
     * Prints the object provided to the standard output.
     */
    public static void println(Object out) {
        System.out.println(out);
    }
    
    /**
     * Creates a {@link Choice}.
     */
    public static <T> Choice<T> Choose(boolean predicate, Supplier<T> function) {
        return new Choice<>(predicate, function);
    }
    
    /**
     * Returns <code>true</code> if the <code>predicate</code> provided is <code>true</code> for at least one of the <code>candidates</code>.
     */
    public static <T> boolean any(Predicate<T> predicate, T... candidates) {
        return C.toStream(candidates).anyMatch(predicate);
    }
    
    /**
     * Represents a simple choice tree. This structure can be used as an alternative to
     * an <code>if</code> / <code>else if</code> / <code>else</code> structure with optionally enforced choice.<p/>
     * 
     * The constructor of this class is not visible; use the convenience {@link U#Choose(boolean, Supplier)} method to create a new instance of this class.
     * It's best practice to statically import this function in client code.
     *
     * @param <T> the return type
     */
    public static class Choice<T> {
        private final L<V2<Boolean, Supplier<T>>> choices;
        
        Choice(boolean predicate, Supplier<T> function) {
            choices = l(v(predicate, function));