ThreadingUtils { public static <X, Y> Optional<Y> some(X start, ThreadingFunction<X, Y> f1) { return doSome(start, new ThreadingFunction[]{ f1 }); }  static Optional<Y> some(X start, ThreadingFunction<X, Y> f1); static Optional<Y> some(X0 start, ThreadingFunction<X0, X1> f1, ThreadingFunction<X1, Y> f2); static Optional<Y> some(X0 start,
                                         ThreadingFunction<X0, X1> f1,
                                         ThreadingFunction<X1, X2> f2,
                                         ThreadingFunction<X2, Y> f3); static Optional<Y> some(
            X0 start,
            ThreadingFunction<X0, X1> f1,
            ThreadingFunction<X1, X2> f2,
            ThreadingFunction<X2, X3> f3,
            ThreadingFunction<X2, Y> f4); static ThreadingFunction<X, Y> partial(ThreadingBiFunction<X, X1, Y> f, X1 arg);  }
@Test public void nullInChain() { Optional<String> booleanName = ThreadingUtils.some(System.getenv(), env -> env.get("HOME1"), String::isEmpty, Object::toString); assertThat(booleanName.isPresent()).isFalse(); }
@Test public void file() { String path = "^/hoge"; Optional<URL> url = ThreadingUtils.some(path, File::new, File::toURI, URI::toURL); assertThat(url.isPresent()).isTrue(); }