public static @Nullable Group getGroupForNode(@NotNull DefaultMutableTreeNode node) {
    Object userObj = node.getUserObject();
    Object value = userObj instanceof Pair<?, ?> pair ? pair.first : userObj;
    return value instanceof Group group ? group : null;
  }
public static @Nullable Group getGroupForNode(@NotNull DefaultMutableTreeNode node)