code: public Collection<RaftSession> getSessions(PrimitiveId primitiveId) {
      return sessions.values().stream()
          .filter(session -> session.getService().serviceId().equals(primitiveId))
          .filter(session -> session.getState().active())
          .collect(Collectors.toSet());
    }
docs: Returns a set of sessions associated with the given service.
  
  @param primitiveId the service identifier
  @return a collection of sessions associated with the given service