code: public List<Long> getRolesAssignedToPrivileges(String id, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
  		ExtractionContext context = getResource(Constants.GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL, id);
  
  		OneloginOAuth2JSONResourceResponse oAuth2Response = null;
  		String afterCursor = null;
  		List<Long> roleIds = new ArrayList<Long>(maxResults);
  		while (oAuth2Response == null || (roleIds.size() < maxResults && afterCursor != null)) {
  			oAuth2Response = context.oAuthClient.resource(context.bearerRequest, OAuth.HttpMethod.GET, OneloginOAuth2JSONResourceResponse.class);
  			if ((afterCursor = getRolesAssignedToPrivilegesBatch(roleIds, context.url, context.bearerRequest, oAuth2Response)) == null) {
  				break;
  			}
  		}
  
  		return roleIds;
  	}
docs: Gets a list of the role ids assigned to a privilege.
  
  @param id
  Id of the privilege
  @param maxResults
  Limit the number of roles returned
  
  @return List of role Ids
  
  @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
  @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
  @throws URISyntaxException - if there is an error when generating the target URL at the getResource call
  
  @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/privileges/get-roles">Get Assigned Roles documentation</a>