I met a problem about doing operation between a lambda parameter
and a int
. Codes are written as follows:
HashMap<Integer, Integer> testMap = new HashMap<>();
testMap.put(1, 1);
testMap.put(2, 2);
testMap.entrySet().removeIf((key, value) -> value < 100);
IDEA shows an error of Operator '<' cannot be applied to '<lambda parameter>', 'int'
.
I am wondering why and if there is any way to fix the problem.