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

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Map;
import java.util.function.BiFunction;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main(String[] args) {
	    BiFunction<Integer, Integer, Integer> add = (a, b) -> a + b;//lambda a, b : a + b
	    BiFunction<Integer, Integer, Integer> sub = (a, b) -> a - b;//lambda a, b : a - b
	
	    //then create a new Map which take the sign and the correspondence BiFunction
	    Map<String, BiFunction> signs = new HashMap<>();
	    signs.put("+", add);
	    signs.put("-", sub);
	
	    int a = 5;
	    int b = 3;
	
	    //loop over the sings map and apply the operation
	    signs.values().forEach(v-> System.out.println(v.apply(a, b)));
	}
}