public class Main { public static void main(String... args) { Converter<String, Integer> integerConverter2 = Integer::valueOf; Integer converted2 = integerConverter2.convert("123"); System.out.println(converted2); // result: 123 } } @FunctionalInterface interface Converter<F, T> { T convert(F from); }