List<FragmentNode> (@NotNull TreePath path) { Object component = path.getLastPathComponent(); if (component instanceof FragmentNode) { return Collections.singletonList((FragmentNode)component); } if (component instanceof TreeNode node) { return IntStreamEx.range(0, node.getChildCount()) .mapToObj(node::getChildAt) .select(FragmentNode.class) .toList(); } return Collections.emptyList(); }