Java tutorial
import java.util.HashMap; import java.util.concurrent.Callable; public class Main { public static void main(String[] args) throws Exception { HashMap<Integer, Callable<String>> m = new HashMap<Integer, Callable<String>>() { { put(0, () -> { return "n"; }); put(1, () -> { return "m"; }); } }; System.out.println(m.get(0).call()); } }