def METHOD_NAME(self, node: Node) -> bool:
    """Decide if given node should be collapsed."""
    if not node.groups:
        return False
    for group in node.groups:
        if group not in self.expanded_groups:
            return self.group_sizes.get(group, 0) > 1
    return False