code: public Subclass withIAMEndpoint(String iamEndpoint) {
          this.iamEndpoint = iamEndpoint;
  
          if ((this.credentials.getCredentials() instanceof IBMOAuthCredentials) &&
          		((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){
          			((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).setIamEndpoint(iamEndpoint);
          			if (((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).getProvider() instanceof DefaultTokenProvider){
          				((DefaultTokenProvider)((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).getProvider()).setIamEndpoint(iamEndpoint);
          				((DefaultTokenProvider)((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).getProvider()).retrieveToken();
          			}
          }
          return getSubclass();
      }
docs: Sets the IAM endpoint to use for token retrieval by the DefaultTokenManager
  and the DefaultTokenProvider. This should only be over written
  for a dev or staging environment
  
  @param iamEndpoint, http endpoint for token retrieval
  @return This object for method chaining.