### Question:
FaasSubnetManagerListener implements DataTreeChangeListener<Subnet> { @Override public void onDataTreeChanged(Collection<DataTreeModification<Subnet>> changes) { executor.execute(() -> executeEvent(changes)); } FaasSubnetManagerListener(DataBroker dataProvider, TenantId gbpTenantId, Uuid faasTenantId,
            Executor executor, UlnDatastoreUtil ulnDatastoreUtil); @Override void onDataTreeChanged(Collection<DataTreeModification<Subnet>> changes); void loadAll(List<Subnet> subnets, List<MappedSubnet> mpSubnets);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testOnDataChangeSubnet() { ArgumentCaptor<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.subnets.rev151013.subnets.container.subnets.Subnet> captor = ArgumentCaptor.forClass( org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.subnets.rev151013.subnets.container.subnets.Subnet.class); doNothing().when(mockUlnDatastoreUtil).submitSubnetToDs(captor.capture()); Uuid expectedFaasSubnetId = new Uuid("c4511aac-ae43-11e5-bf7f-feff819cdc9f"); subnetManagerListener.setExpectedFaasSubnetId(expectedFaasSubnetId); Subnet testSubnet = makeTestSubnet(); subnetManagerListener.setExpectedGbpSubnet(testSubnet); DataTreeModification<Subnet> mockDataTreeModification = mock(DataTreeModification.class); DataObjectModification<Subnet> mockModification = mock(DataObjectModification.class); doReturn(mockModification).when(mockDataTreeModification).getRootNode(); doReturn(DataObjectModification.ModificationType.WRITE).when(mockModification).getModificationType(); doReturn(testSubnet).when(mockModification).getDataAfter(); subnetManagerListener.onDataTreeChanged(Collections.singletonList(mockDataTreeModification)); assertTrue("testOnDataChangeSubnet: Actual Faas SubnetId is NOT as expected", expectedFaasSubnetId.equals(captor.getValue().getUuid())); }