PathListener implements DataTreeChangeListener<Flow> { @Override public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Flow>> changes) { if (changes == null) { LOG.info("This line should never be reached because of @Nonnull."); return; } for (DataTreeModification<Flow> change : changes) { if (change == null) { continue; } final InstanceIdentifier<Flow> iid = change.getRootPath().getRootIdentifier(); if (iid.firstKeyOf(Table.class).getId().equals(DEFAULT_TABLE_ID)) { final DataObjectModification<Flow> rootNode = change.getRootNode(); switch (rootNode.getModificationType()) { case WRITE: onFlowRuleCreated(iid, rootNode.getDataBefore(), rootNode.getDataAfter()); break; case SUBTREE_MODIFIED: onFlowRuleUpdated(iid, rootNode.getDataBefore(), rootNode.getDataAfter()); break; case DELETE: onFlowRuleDeleted(iid, rootNode.getDataBefore()); } } } } PathListener(final PathManagerUpdater updater); @Override void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Flow>> changes);  }
@Test public void testNullValueChanged() throws Exception { try { Collection<DataTreeModification<Flow>> nullChanges = null; pathListener1.onDataTreeChanged(nullChanges); pathListener2.onDataTreeChanged(nullChanges); } catch (Exception e) { Assert.assertEquals(IllegalArgumentException.class, e.getClass()); } Collection<DataTreeModification<Flow>> changes = new ArrayList<>(); DataTreeModification<Flow> change0 = null; changes.add(change0); pathListener1.onDataTreeChanged(changes); pathListener2.onDataTreeChanged(changes); }