There is almost a striking similarity between the endings of Harry Potter and The Sopranos, although such a claim may look strange on its surface. After all, the Sopranos ended on a note of dread and uncertainty, pulled a stunt on its audiences, and played them for fools. On the other hand, HP7 ends with a sunny disposition and showed that all is right in the world.
Well, the similarity between that both endings told their audiences absolutely nothing about the protagonists. No one knows if Tony is dead and what he does, and no one knows anything about Harry, Hermione, Ron, and their respective families and adult careers.
Except whereas The Sopranos made a conscious decision to make its uncertainly in extremely explicit terms, J.K. Rowlings did the same thing but without the explicitness. In the end, both of their audiences know nothing about the fate of the main characters. They are equally mysterious, but in different ways.
Therefore, it is not surprising that both end with a gathering of their respective families. And in some sense this is fitting, since both celebrate the family, but does so in vastly different ways.