import java.util.function.Function;
import java.util.function.Predicate;

class Main {
    //Stepik code: start
    public static <T, U> Function<T, U> ternaryOperator(
            Predicate<? super T> condition,
            Function<? super T, ? extends U> ifTrue,
            Function<? super T, ? extends U> ifFalse) {

        return null; // your implementation here

    }
//Stepik code: end
}
