### Question:
ProductBindingCreator implements ResourceChangeListener { @Override public void onChange(List<ResourceChange> list) { LOG.debug("Change detected somewhere..."); list.stream().filter(change -> { String path = change.getPath(); LOG.debug("Processing path {}", path); return !path.endsWith(JcrConstants.JCR_CONTENT) && path.contains(Constants.COMMERCE_BUCKET_PATH); }).forEach(change -> { if (change.getType() == ResourceChange.ChangeType.ADDED) { processAddition(change); } if (change.getType() == ResourceChange.ChangeType.REMOVED) { processDeletion(change); } }); }  @Override void onChange(List<ResourceChange> list);  }### Answer:
@Test public void testCreateBindingWhenConfigurationIsCreated() throws WCMException, PersistenceException { Assert.assertNotNull(context.resourceResolver().getResource("/conf/testing/settings/cloudconfigs")); ResourceChange change = new ResourceChange(ResourceChange.ChangeType.ADDED, "/conf/testing/settings/cloudconfigs/commerce", false); creator.onChange(ImmutableList.of(change)); Assert.assertNotNull(context.resourceResolver().getResource("/var/commerce/products/testing-english")); Resource config = context.resourceResolver().getResource("/conf/testing/settings/cloudconfigs/commerce/jcr:content"); Assert.assertEquals("/var/commerce/products/testing-english", config.getValueMap().get("cq:catalogPath")); }
@Test public void testDeleteBindingWhenConfigurationIsDeleted() { ResourceChange change = new ResourceChange(ResourceChange.ChangeType.REMOVED, "/conf/testing-to-be-deleted/settings/cloudconfigs/commerce", false); creator.onChange(ImmutableList.of(change)); Assert.assertNull(context.resourceResolver().getResource("/var/commerce/products/testing-to-be-deleted")); }