code: public static Optional<String> extractStreamId(String filter) {
          if (isNullOrEmpty(filter)) {
              return Optional.empty();
          }
          final Matcher streamIdMatcher = filterStreamIdPattern.matcher(filter);
          if (streamIdMatcher.find()) {
              return Optional.of(streamIdMatcher.group(2));
          }
          return Optional.empty();
      }
docs: Extracts the last stream id from the filter string passed as part of the elasticsearch query. This is used later
  to pass to possibly existing message decorators for stream-specific configurations.
  
  The assumption is that usually (when listing/searching messages for a stream) only a single stream filter is passed.
  When this is not the case, only the last stream id will be taked into account.
  
  This is currently a workaround. A better solution would be to pass the stream id which is supposed to be the scope
  for a search query as a separate parameter.
  
  @param filter the filter string like "streams:xxxyyyzzz"
  @return the optional stream id