As i understand your problem, you will need the Multi User Chat to receive a proper invitation. Because this invitation can include a room password, GroupChat can not help you anymore. But read the thread first!
P.S. The smack source code also includes the folder
test\org\jivesoftware\smackx with nice basic examples like
GroupChatInvitationTest.java. But I beliven you will need the MUC invitation.
If the room that you will be using does not support Multi User Chat (MUC) then you could use GroupChatInvitation to listen for group chat invitations and GroupChat to join the room. If your room does support MUC you could then use the new class MultiUserChat to join and listen for invitations.
As Joachim said, you could take a look at GroupChatInvitationTest to see a running example of group chat invitations. To learn how to use Multi User Chat in Smack you can take a look at MultiUserChatTest which provides some basic usage examples (we are still adding new functionalities to this class so we don’'t have yet a better tutorial document).