code: public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
        throws RemoteException {
      // Get the UserService.
      UserServiceInterface userService = adManagerServices.get(session, UserServiceInterface.class);
  
      // Get all roles.
      Role[] roles = userService.getAllRoles();
  
      int i = 0;
      for (Role role : roles) {
        System.out.printf(
            "%d) Role with ID %d and name '%s' was found.%n", i++, role.getId(), role.getName());
      }
  
      System.out.printf("Number of results found: %d%n", roles.length);
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.