code: public void useClient(AmazonS3 client) {
          String region = client.getRegionName();
  
          synchronized (transferManagersByRegion) {
              TransferManager tm = transferManagersByRegion.remove(region);
              if (tm != null) {
                  tm.shutdownNow();
              }
              clientsByRegion.put(region, client);
          }
      }
docs: Force the client cache to provide a certain client for the region which
  that client is configured. This can be useful to provide clients with
  different {@link com.amazonaws.services.s3.S3ClientOptions} or use a
  {@link com.amazonaws.services.s3.AmazonS3EncryptionClient} in place of a
  regular client.
  
  Using a new client will also forcibly shut down any
  {@link TransferManager} that has been instantiated with that client, with
  the {@link TransferManager#shutdownNow()} method.
  
  @param client
  An {@link AmazonS3} to use in the cache. Its region will
  be detected automatically.