import java.util.function.Consumer; 
import java.util.function.Function; 

public class Wrapper<T> { 

    private final T t; 

    public Wrapper(T t) { this.t = t; } 

    public <R> R pipe(Function<? super T, ? extends R> f) { return f.apply(t); } 

    public void pipe(Consumer<? super T> c) { c.accept(t); } 

    public static void main(String... args) { 
        new Wrapper<>("hello world").pipe(System.out::println); 

        Consumer<String> c = System.out::println; 
        Function<String, Void> f = System.out::println; 
    } 

} 

