src/main/java/me/paulbares/subscription/ApproverWorkflowRegistrar.java
protected Map<String, Set<Subscriber<Notification>>> collectSubscribers(Set<String> users, Set<String> groups) {
    Map<String, Set<Subscriber<Notification>>> result = new HashMap<>(); // collect Subscriber per user
    users.forEach(u -> {
      Set<Subscriber<Notification>> subscribers = this.subscribersByUserId.getSubscribers(u);
      if (subscribers != null) {
        result.put(u, subscribers);
      }
    });
    groups.forEach(g -> {
      Entry entry = this.subscribersByGroupId.get(g);
      if (entry != null) {
        for (Map.Entry<String, Set<Subscriber<Notification>>> e : entry.subscriberByUserId.entrySet()) {
          result.computeIfAbsent(e.getKey(), k -> new HashSet<>()).addAll(e.getValue());
        }
      }
    });
    return result;
  }
/**
   * Collects all {@link Subscriber} associated to the given set of users and groups of users indexed by user id.
   *
   * @param users the sets of users
   * @param groups the sets of groups of users
   * @return the {@link Subscriber subscribers} by user id.
   */
Collects all  Subscriber associated to the given set of users and groups of users indexed by user id.
@param users the sets of users
@param groups the sets of groups of users
@return the  Subscriber subscribers by user id.
Collects all Subscriber associated to the given set of users and groups of users indexed by user id . @param users the sets of users @param groups the sets of groups of users @return the Subscriber subscribers by user id .
protected Map<String, Set<Subscriber<Notification>>> collectSubscribers(Set<String> users, Set<String> groups) {
    Map<String, Set<Subscriber<Notification>>> result = new HashMap<>(); 
    users.forEach(u -> {
      Set<Subscriber<Notification>> subscribers = this.subscribersByUserId.getSubscribers(u);
      if (subscribers != null) {
        result.put(u, subscribers);
      }
    });
    groups.forEach(g -> {
      Entry entry = this.subscribersByGroupId.get(g);
      if (entry != null) {
        for (Map.Entry<String, Set<Subscriber<Notification>>> e : entry.subscriberByUserId.entrySet()) {
          result.computeIfAbsent(e.getKey(), k -> new HashSet<>()).addAll(e.getValue());
        }
      }
    });
    return result;
  }
protected Map < String , Set < Subscriber < Notification > > > collectSubscribers ( Set < String > users , Set < String > groups ) { Map < String , Set < Subscriber < Notification > > > result = new HashMap < > ( ) ; users . forEach ( u -> { Set < Subscriber < Notification > > subscribers = this . subscribersByUserId . getSubscribers ( u ) ; if ( subscribers != null ) { result . put ( u , subscribers ) ; } } ) ; groups . forEach ( g -> { Entry entry = this . subscribersByGroupId . get ( g ) ; if ( entry != null ) { for ( Map . Entry < String , Set < Subscriber < Notification > > > e : entry . subscriberByUserId . entrySet ( ) ) { result . computeIfAbsent ( e . getKey ( ) , k -> new HashSet < > ( ) ) . addAll ( e . getValue ( ) ) ; } } } ) ; return result ; }
Collects all {@link Subscriber} associated to the given set of users and groups of users indexed by user id.
Collects all { @link Subscriber } associated to the given set of users and groups of users indexed by user id .
// collect Subscriber per user