### Question:
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @Override protected void onWrite(DataObjectModification<ForwardingByTenant> rootNode, InstanceIdentifier<ForwardingByTenant> rootIdentifier) { ForwardingByTenant forwardingByTenant = rootNode.getDataAfter(); updateForwarding(rootIdentifier, forwardingByTenant); } ForwardingResolver(DataBroker dataProvider);   }### Answer:
@Test public void testOnWrite() throws Exception { ForwardingByTenant forwardingByTenant = new ForwardingByTenantBuilder().setTenantId(TENANT_ID_1).build(); DataObjectModification<ForwardingByTenant> domMock = Mockito.mock(DataObjectModification.class); Mockito.when(domMock.getDataAfter()).thenReturn(forwardingByTenant); InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid = IidFactory.forwardingByTenantIid(TENANT_ID_1); fwdResolver.onWrite(domMock, forwardingByTenantIid); ReadOnlyTransaction rTx = getDataBroker().newReadOnlyTransaction(); Optional<ForwardingByTenant> potenatialFwdByTenant = rTx.read(LogicalDatastoreType.OPERATIONAL, forwardingByTenantIid).get(); Assert.assertTrue(potenatialFwdByTenant.isPresent()); Assert.assertEquals(forwardingByTenant, potenatialFwdByTenant.get()); }