.scope(LocationScope.REGION)
.id(region)
.description("region")
.build());
SecurityGroup origGroup = groupBuilder.build();
ImmutableMultimap.Builder<String, String> permBuilder = ImmutableMultimap.builder();
permBuilder.put(origGroup.getOwnerId(), origGroup.getId());
SecurityGroup newGroup = extension.addIpPermission(IpProtocol.TCP,
22,
40,
permBuilder.build(),
emptyStringSet(),
emptyStringSet(),
origGroup);
assertEquals(1, newGroup.getIpPermissions().size());
IpPermission newPerm = Iterables.getOnlyElement(newGroup.getIpPermissions());
assertNotNull(newPerm);
assertEquals(IpProtocol.TCP, newPerm.getIpProtocol());
assertEquals(22, newPerm.getFromPort());
assertEquals(40, newPerm.getToPort());