public void testCreateSecurityGroup() {

    SecurityGroup newSecurityGroup = api().createWithNameAndDescription(SECURITYGROUP, "jclouds");

    securityGroup = newSecurityGroup;
    Logger.getAnonymousLogger().info("created securityGroup: " + securityGroup);

    assertEquals(securityGroup.getName(), SECURITYGROUP);
    assertEquals(securityGroup.getDescription(), "jclouds");

    checkSecurityGroup(newSecurityGroup);
  }
 static void checkSecurityGroup(SecurityGroup securityGroup) {
   checkNotNull(
       securityGroup.getName(), "Name cannot be null for a SecurityGroup: %s", securityGroup);
   checkNotNull(
       securityGroup.getDescription(),
       "Description cannot be null for a SecurityGroup: %s",
       securityGroup);
   checkNotNull(
       securityGroup.getOwnerId(),
       "OwnerId cannot be null for a SecurityGroup: %s",
       securityGroup);
   checkNotNull(
       securityGroup.getVpcId(), "VpcId cannot be null for a SecurityGroup: %s", securityGroup);
   for (EC2SecurityGroup security : securityGroup.getEC2SecurityGroups()) {
     checkEC2SecurityGroup(security);
   }
 }