code: public void createItem(BareJid jid, String name, String[] groups) throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
          final XMPPConnection connection = getAuthenticatedConnectionOrThrow();
  
          // Create and send roster entry creation packet.
          RosterPacket rosterPacket = new RosterPacket();
          rosterPacket.setType(IQ.Type.set);
          RosterPacket.Item item = new RosterPacket.Item(jid, name);
          if (groups != null) {
              for (String group : groups) {
                  if (group != null && group.trim().length() > 0) {
                      item.addGroupName(group);
                  }
              }
          }
          rosterPacket.addRosterItem(item);
          connection.createStanzaCollectorAndSend(rosterPacket).nextResultOrThrow();
      }
docs: Creates a new roster item. The server will asynchronously update the roster with the subscription status.
  <p>
  There will be no presence subscription request. Consider using
  {@link #createItemAndRequestSubscription(BareJid, String, String[])} if you also want to request a presence
  subscription from the contact.
  </p>
  
  @param jid the XMPP address of the contact (e.g. johndoe@jabber.org)
  @param name the nickname of the user.
  @param groups the list of group names the entry will belong to, or <tt>null</tt> if the the roster entry won't
  belong to a group.
  @throws NoResponseException if there was no response from the server.
  @throws XMPPErrorException if an XMPP exception occurs.
  @throws NotLoggedInException If not logged in.
  @throws NotConnectedException
  @throws InterruptedException
  @since 4.4.0