I\'m trying to refactor the following code to lambda expressions with `stream, especially the nested foreach loops:
public static Result match (Response rsp) {
Try to use map which transform the original source.
map
rsp.getFirstNodes().stream().map(FirstNode::getSndNodes) .filter(sndNode-> sndNode.isValid()) .forEach(sndNode->{ // No do the sndNode parsing operation Here. })