@Nullable
    private Group getSingleGroup() {
      if (!roots.isEmpty() || groups.size() != 1) return null;
      return groups.values().stream().findFirst().orElse(null);
    }
@Nullable
    private Group getSingleGroup()