I'm trying to convert old-style for loop with some newly generated variables and if statements int the new style using java streams and lambda expression.
for (MyClass a : list_1) {
if (a.myMethod() != null) {
List<Integer> list_2 = myMap.get(/*some code*/);
if (list_2 == null) {
list_2 = new ArrayList<>();
myMap.put(/*some code*/);
}
list_2.add(/*some code*/);
}
}