code: public static SenderConfiguration getSenderConfiguration(TransportsConfiguration transportsConfiguration,
                                                               String scheme) {
          Map<String, SenderConfiguration> senderConfigurations =
                  transportsConfiguration.getSenderConfigurations().stream().collect(Collectors
                          .toMap(senderConf ->
                                  senderConf.getScheme().toLowerCase(Locale.getDefault()), config -> config));
  
          return Constants.HTTPS_SCHEME.equals(scheme) ?
                  senderConfigurations.get(Constants.HTTPS_SCHEME) : senderConfigurations.get(Constants.HTTP_SCHEME);
      }
docs: Extract sender configuration from transport configuration.
  
  @param transportsConfiguration {@link TransportsConfiguration} which sender configurations should be extracted.
  @param scheme scheme of the transport.
  @return extracted {@link SenderConfiguration}.