### Question:
JcloudsLocationSecurityGroupCustomizer extends BasicJcloudsLocationCustomizer { public JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location, IpPermission... permissions) { addPermissionsToLocation(location, ImmutableList.copyOf(permissions)); return this; } protected  JcloudsLocationSecurityGroupCustomizer(String applicationId); protected  JcloudsLocationSecurityGroupCustomizer(String applicationId, Supplier<Cidr> sshCidrSupplier); static JcloudsLocationSecurityGroupCustomizer getInstance(String applicationId); static JcloudsLocationSecurityGroupCustomizer getInstance(Entity entity); JcloudsLocationSecurityGroupCustomizer setRetryExceptionPredicate(Predicate<Exception> predicate); JcloudsLocationSecurityGroupCustomizer setSshCidrSupplier(Supplier<Cidr> cidrSupplier); JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location, IpPermission... permissions); JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location, SecurityGroupDefinition securityGroupDefinition); JcloudsLocationSecurityGroupCustomizer addPermissionsToLocation(final JcloudsMachineLocation location, final Iterable<IpPermission> permissions); void removePermissionsFromLocation(final JcloudsMachineLocation location, final Iterable<IpPermission> permissions); @Override void customize(JcloudsLocation location, ComputeService computeService, Template template); String getBrooklynCidrBlock(); static Predicate<Exception> newAwsExceptionRetryPredicate();  }### Answer:
@Test public void testAddPermissionWhenNoExtension() { IpPermission ssh = newPermission(22); IpPermission jmx = newPermission(31001); String nodeId = "node"; when(securityApi.listSecurityGroupsForNode(nodeId)).thenReturn(Collections.<SecurityGroup>emptySet()); RuntimeException exception = null; try { customizer.addPermissionsToLocation(ImmutableList.of(ssh, jmx), nodeId, computeService); } catch(RuntimeException e){ exception = e; } assertNotNull(exception); }