code: private static AdGroup createAdGroup(
        AdWordsServicesInterface services, AdWordsSession session, Campaign campaign)
        throws RemoteException {
      AdGroupServiceInterface adGroupService = services.get(session, AdGroupServiceInterface.class);
  
      AdGroup group = new AdGroup();
      group.setName("Dynamic remarketing ad group");
      group.setCampaignId(campaign.getId());
      group.setStatus(AdGroupStatus.ENABLED);
  
      AdGroupOperation op = new AdGroupOperation();
      op.setOperand(group);
      op.setOperator(Operator.ADD);
      AdGroupReturnValue result = adGroupService.mutate(new AdGroupOperation[] {op});
      return result.getValue(0);
    }
docs: Creates an ad group in the specified campaign.
  
  @param campaign the campaign to which the ad group should be attached.
  @return the ad group that was created.