### Question:
Ec2SecurityGroupService implements SecurityGroupService { @Override public void authorizeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission) { client(dataCenter).authorizeSecurityGroupIngress( new AuthorizeSecurityGroupIngressRequest(groupName, toIpPermissions(permission))); } @Inject  Ec2SecurityGroupService(Provider<AmazonEC2> amazonEC2Provider,
      @Named(SecurityGroupModule.SECURITY_GROUP_DATACENTERS_PROPERTY) Map<String, Region> regions); @Override boolean exists(String groupName, String dataCenter); @Override void create(String groupName, String dataCenter); @Override ImmutableSet<SecurityGroupPermission> getPermissions(String groupName, String dataCenter); @Override void authorizeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission); @Override void revokeIngressRules(String groupName, String dataCenter, SecurityGroupPermission permission);  }### Answer:
@Test public void authorizeIngressRules() { amazonEc2.setRegion(region); amazonEc2.authorizeSecurityGroupIngress(new AuthorizeSecurityGroupIngressRequest( "securityGroupName", ImmutableList.of(ipPermission(7000, "1.1.1.1/32", "2.2.2.2/32")))); replayAll(); service().authorizeIngressRules("securityGroupName", "dc1", groupPermission(7000, "1.1.1.1/32", "2.2.2.2/32")); }