getParentNodeForChildren

Returns the parent node from the perspective of the children of this node.

That is, this method returns this for everything except NodeList. A NodeList returns its parent node instead. This is because a NodeList sets the parent of all its children to its own parent node (see com.github.javaparser.ast.NodeList for details).