private void addVAppNetworkWithSecurityGroupOnVApp(ImmutableList<String> securityGroups, String vAppUrn) {
String newVAppNetworkName = generateVAppNetworkName(network.getName(), securityGroups);
// Create a vAppNetwork with firewall rules
NetworkConfigSection newSection = generateNetworkConfigSection(securityGroups, newVAppNetworkName);
Task editNetworkConfigSection = vAppApi.editNetworkConfigSection(vAppUrn, newSection);
assertTrue(retryTaskSuccess.apply(editNetworkConfigSection), String.format(TASK_COMPLETE_TIMELY, "editNetworkConfigSection"));
attachVmToVAppNetwork(vm, newVAppNetworkName);
}