docs: private synchronized void refreshAccessToken() throws ConnectionException, HTTPException {
          if (!isTokenExpired()) {
              return;
          }
  
          Map<String, String> params = new HashMap<>();
          params.put(Constants.PARAM_CLIENT_ID, clientId);
          params.put(Constants.PARAM_CLIENT_SECRET, clientSecret);
  
          if (isUserAuthFlow() && accessToken.getRefreshToken() != null) {
              // For user based authentication, refresh the token
              params.put(Constants.PARAM_GRANT_TYPE, Constants.GRANT_TYPE_REFRESH_TOKEN);
              params.put(Constants.PARAM_REFRESH_TOKEN, accessToken.getRefreshToken());
  
          } else {
              // For app based authentication, reload the token
              params.put(Constants.PARAM_GRANT_TYPE, Constants.GRANT_TYPE_CLIENT_CREDENTIALS);
          }
  
          loadAccessToken(params);
      }