/* package whatever; // don't place package name! */



import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

class Tmp {
    static <T> T readValue(Supplier<T> s, Class<T> type) throws Exception {
        return s.get();
    }
    interface Source extends Supplier<String>, AutoCloseable {
        public default void close() throws Exception {}
    }

    public static void main(String[] args) {
        Stream.of("one", "two", "three")
              .map(s -> {
                  try(Source source = () -> s) {
                      return (readValue(source, String.class));
                  }
                  catch(Exception ex) {
                      return null;
                  }
              })
              .forEach(System.out::println);
    }
}
