public static void runExample(
      AdManagerServices adManagerServices,
      AdManagerSession session,
      long masterCreativeId,
      long companionCreativeId)
      throws RemoteException {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        adManagerServices.get(session, CreativeSetServiceInterface.class);

    CreativeSet creativeSet = new CreativeSet();
    creativeSet.setName("Creative set #" + new Random().nextInt(Integer.MAX_VALUE));
    creativeSet.setMasterCreativeId(masterCreativeId);
    creativeSet.setCompanionCreativeIds(new long[] {companionCreativeId});

    // Create the creative set on the server.
    CreativeSet createdCreativeSet = creativeSetService.createCreativeSet(creativeSet);

    System.out.printf(
        "A creative set with ID %d, master creative ID %d, "
            + "and companion creative IDs [%s] was created.%n",
        createdCreativeSet.getId(),
        createdCreativeSet.getMasterCreativeId(),
        Longs.join(",", createdCreativeSet.getCompanionCreativeIds()));
  }
public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long masterCreativeId , long companionCreativeId ) throws RemoteException { CreativeSetServiceInterface creativeSetService = adManagerServices . get ( session , CreativeSetServiceInterface . class ) ; CreativeSet creativeSet = new CreativeSet ( ) ; creativeSet . setName ( "Creative set #" + new Random ( ) . nextInt ( Integer . MAX_VALUE ) ) ; creativeSet . setMasterCreativeId ( masterCreativeId ) ; creativeSet . setCompanionCreativeIds ( new long [ ] { companionCreativeId } ) ; CreativeSet createdCreativeSet = creativeSetService . createCreativeSet ( creativeSet ) ; System . out . printf ( "A creative set with ID %d, master creative ID %d, " + "and companion creative IDs [%s] was created.%n" , createdCreativeSet . getId ( ) , createdCreativeSet . getMasterCreativeId ( ) , Longs . join ( "," , createdCreativeSet . getCompanionCreativeIds ( ) ) ) ; }
Runs the example.

@param adManagerServices the services factory.
@param session the session.
@param masterCreativeId the ID of the master creative in the creative set.
@param companionCreativeId the ID of the companion creative in the creative set.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors.