code: public void send(RosterGroup rosterGroup, Jid targetUserID) throws NotConnectedException, InterruptedException {
          // Create a new message to send the roster
          Message msg = new Message(targetUserID);
          // Create a RosterExchange Package and add it to the message
          RosterExchange rosterExchange = new RosterExchange();
          for (RosterEntry entry : rosterGroup.getEntries()) {
              rosterExchange.addRosterEntry(entry);
          }
          msg.addExtension(rosterExchange);
  
          XMPPConnection connection = weakRefConnection.get();
          // Send the message that contains the roster
          connection.sendStanza(msg);
      }
docs: Sends a roster group to userID. All the entries of the group will be sent to the
  target user.
  
  @param rosterGroup the roster group to send
  @param targetUserID the user that will receive the roster entries
  @throws NotConnectedException
  @throws InterruptedException