docs: private void updateCallbackConfiguration(String action, String type, String entity, List<AlarmCallbackConfiguration> streamCallbacks) {
          final AtomicBoolean ran = new AtomicBoolean(false);
  
          streamCallbacks.stream()
                  .filter(callback -> callback.getType().equals(EmailAlarmCallback.class.getCanonicalName()))
                  .forEach(callback -> {
                      ran.set(true);
                      final Map<String, Object> configuration = callback.getConfiguration();
                      String key;
  
                      if ("users".equals(type)) {
                          key = EmailAlarmCallback.CK_USER_RECEIVERS;
                      } else {
                          key = EmailAlarmCallback.CK_EMAIL_RECEIVERS;
                      }
  
                      @SuppressWarnings("unchecked")
                      final List<String> recipients = (List<String>) configuration.get(key);
                      if ("add".equals(action)) {
                          if (!recipients.contains(entity)) {
                              recipients.add(entity);
                          }
                      } else {
                          if (recipients.contains(entity)) {
                              recipients.remove(entity);
                          }
                      }
                      configuration.put(key, recipients);
  
                      final AlarmCallbackConfiguration updatedConfig = ((AlarmCallbackConfigurationImpl) callback).toBuilder()
                              .setConfiguration(configuration)
                              .build();
                      try {
                          alarmCallbackConfigurationService.save(updatedConfig);
                      } catch (ValidationException e) {
                          throw new BadRequestException("Unable to save alarm callback configuration", e);
                      }
                  });
  
          if (!ran.get()) {
              throw new BadRequestException("Unable to " + action + " receiver: Stream has no email alarm callback.");
          }
      }