### Question:
Ec2SecurityGroupService implements SecurityGroupService { @Override public boolean exists(String groupName, String dataCenter) { return getSecurityGroup(groupName, dataCenter).isPresent(); } @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 exists_false() { securityGroupStartingRules(); replayAll(); assertFalse(service().exists("thisDoesntExist", "dc1")); }
@Test public void exists_true() { securityGroupStartingRules(); replayAll(); assertTrue(service().exists("securityGroupName", "dc1")); }