@Override
public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group) {
SecurityGroupBuilder builder = SecurityGroupBuilder.fromSecurityGroup(checkNotNull(group, "group"));
builder.ipPermission(checkNotNull(ipPermission, "ipPermission"));
SecurityGroup newGroup = builder.build();
if (groups.containsKey(newGroup.getId())) {
groups.remove(newGroup.getId());