@Test public void map() { Any2<String, String> left = Any2.left("foo"); Any2<String, String> right = Any2.right("fizzbuzz"); assertEquals(Any2.left(3), left.map(String::length, (s) -> { fail(); return 0; })); assertEquals(Any2.right(8), right.map((s) -> { fail(); return 0; }, String::length)); }
public abstract <X, Y> Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn);
Any2 { public abstract <X, Y> Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn); }
Any2 { public abstract <X, Y> Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn); private  Any2(); }
Any2 { public abstract <X, Y> Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn); private  Any2(); static Any2<T, U> left(@NonNull T t); static Any2<T, U> right(@NonNull U u); abstract Optional<T> getLeft(); abstract Optional<U> getRight(); abstract Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn); abstract X mapCombine(Function<? super T, ? extends X> left_fn, Function<? super U, ? extends X> right_fn); }
Any2 { public abstract <X, Y> Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn); private  Any2(); static Any2<T, U> left(@NonNull T t); static Any2<T, U> right(@NonNull U u); abstract Optional<T> getLeft(); abstract Optional<U> getRight(); abstract Any2<X, Y> map(Function<? super T, X> left_fn, Function<? super U, Y> right_fn); abstract X mapCombine(Function<? super T, ? extends X> left_fn, Function<? super U, ? extends X> right_fn);  }