adUnit.setTargetWindow(AdUnitTargetWindow.BLANK);
adUnit.setExplicitlyTargeted(true);
adUnit.setTargetPlatform(TargetPlatform.WEB);
// Create master ad unit size.
AdUnitSize masterAdUnitSize = new AdUnitSize();
masterAdUnitSize.setSize(new Size(400, 300, false));
masterAdUnitSize.setEnvironmentType(EnvironmentType.VIDEO_PLAYER);
// Create companion sizes.
AdUnitSize companionAdUnitSize1 = new AdUnitSize();
companionAdUnitSize1.setSize(new Size(300, 250, false));
companionAdUnitSize1.setEnvironmentType(EnvironmentType.BROWSER);
AdUnitSize companionAdUnitSize2 = new AdUnitSize();
companionAdUnitSize2.setSize(new Size(728, 90, false));
companionAdUnitSize2.setEnvironmentType(EnvironmentType.BROWSER);
// Add companions to master ad unit size.
masterAdUnitSize.setCompanions(new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2});
// Set the size of possible creatives that can match this ad unit.