long masterCreativeId, long companionCreativeId) throws Exception {
// Get the CreativeSetService.
CreativeSetServiceInterface creativeSetService =
dfpServices.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()));
}