BasicJcloudsLocationCustomizer extends BasicConfigurableObject implements JcloudsLocationCustomizer, EntityInitializer { @Override public void apply(EntityLocal entity) { ConfigKey<Object> subkey = BrooklynConfigKeys.PROVISIONING_PROPERTIES.subKey(JcloudsLocationConfig.JCLOUDS_LOCATION_CUSTOMIZERS.getName()); ConfigBag provisioningProperties = ConfigBag.newInstance(entity.config().get(BrooklynConfigKeys.PROVISIONING_PROPERTIES)); Collection<JcloudsLocationCustomizer> existingCustomizers = provisioningProperties.get(JcloudsLocationConfig.JCLOUDS_LOCATION_CUSTOMIZERS); List<? super JcloudsLocationCustomizer> merged; if (existingCustomizers == null) { merged = ImmutableList.<JcloudsLocationCustomizer>of(this); } else { merged = Lists.newArrayListWithCapacity(1 + existingCustomizers.size()); merged.addAll(existingCustomizers); merged.add(this); } LOG.debug("{} set location customizers on {}: {}", new Object[]{this, entity, Iterables.toString(merged)}); entity.config().set(subkey, merged); } BasicJcloudsLocationCustomizer();  BasicJcloudsLocationCustomizer(Map<?, ?> params);  BasicJcloudsLocationCustomizer(final ConfigBag params); @Override void apply(EntityLocal entity); @Override void customize(JcloudsLocation location, ComputeService computeService, TemplateBuilder templateBuilder); @Override void customize(JcloudsLocation location, ComputeService computeService, Template template); @Override void customize(JcloudsLocation location, ComputeService computeService, TemplateOptions templateOptions); @Override void customize(JcloudsLocation location, NodeMetadata node, ConfigBag setup); @Override void customize(JcloudsLocation location, ComputeService computeService, JcloudsMachineLocation machine); @Override void preRelease(JcloudsMachineLocation machine); @Override void postRelease(JcloudsMachineLocation machine); @Override void preReleaseOnObtainError(JcloudsLocation jcloudsLocation, @Nullable JcloudsMachineLocation machineLocation, Exception cause); @Override void postReleaseOnObtainError(JcloudsLocation jcloudsLocation, @Nullable JcloudsMachineLocation machineLocation, Exception cause);  }
@Test public void testApplyToEntity() { TestEntity entity = app.createAndManageChild(EntitySpec.create(TestEntity.class)); assertNoCustomizers(entity); testCustomizer.apply(entity); assertCustomizers(entity, 1); }