code: private static void move(BareJid entity, Map<BareJid, Map<Resourcepart, Presence>> from, Map<BareJid, Map<Resourcepart, Presence>> to) {
          Map<Resourcepart, Presence> presences = from.remove(entity);
          if (presences != null && !presences.isEmpty()) {
              to.put(entity, presences);
          }
      }
docs: Move presences from 'entity' from one presence map to another.
  
  @param entity the entity
  @param from the map to move presences from
  @param to the map to move presences to