### Question:
ActionDefinitionListener extends DataTreeChangeHandler<ActionDefinition> { @Override protected void onSubtreeModified(DataObjectModification<ActionDefinition> rootNode, InstanceIdentifier<ActionDefinition> rootIdentifier) { ActionDefinition actionDefinitionAfter = checkNotNull(rootNode.getDataAfter()); Action ourAction = SubjectFeatures.getAction(actionDefinitionAfter.getId()); if (ourAction != null) { SupportedActionDefinition supportedActionDefinition = createSupportedActionDefinition(ourAction); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedActionDefinition.class, supportedActionDefinition.getKey()), supportedActionDefinition, true); Futures.addCallback(wTx.submit(), logDebugResult(supportedActionDefinition.getKey(), PUT), MoreExecutors.directExecutor()); } } ActionDefinitionListener(DataBroker dataBroker);   }### Answer:
@Test public void testOnSubtreeModified() { when(rootNode.getModificationType()).thenReturn(DataObjectModification.ModificationType.SUBTREE_MODIFIED); WriteTransaction wt = resetTransaction(); listener.onDataTreeChanged(changes); verify(listener).onSubtreeModified(rootNode, rootIdentifier); }