### Question:
ClassifierDefinitionListener extends DataTreeChangeHandler<ClassifierDefinition> { @Override protected void onDelete(DataObjectModification<ClassifierDefinition> rootNode, InstanceIdentifier<ClassifierDefinition> rootIdentifier) { ClassifierDefinition classifierDefinitionBefore = checkNotNull(rootNode.getDataBefore()); Classifier ourClassifier = SubjectFeatures.getClassifier(classifierDefinitionBefore.getId()); if (ourClassifier != null) { SupportedClassifierDefinitionKey supportedClassifierDefinitionKey = new SupportedClassifierDefinitionKey(ourClassifier.getId()); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, CAPABILITIES_IID.child(SupportedClassifierDefinition.class, supportedClassifierDefinitionKey)); Futures.addCallback(wTx.submit(), logDebugResult(supportedClassifierDefinitionKey, DELETED), MoreExecutors.directExecutor()); } } ClassifierDefinitionListener(DataBroker dataBroker);   }### Answer:
@Test public void testOnDelete() { when(rootNode.getModificationType()).thenReturn(DataObjectModification.ModificationType.DELETE); WriteTransaction wt = resetTransaction(); listener.onDataTreeChanged(changes); verify(listener).onDelete(rootNode, rootIdentifier); }