MdsalUtils { public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean delete( final LogicalDatastoreType store, final InstanceIdentifier<D> path) { boolean result = false; final WriteTransaction transaction = databroker.newWriteOnlyTransaction(); transaction.delete(store, path); CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit(); try { future.checkedGet(); result = true; } catch (TransactionCommitFailedException e) { LOG.warn("Failed to delete {} ", path, e); } return result; } MdsalUtils(DataBroker dataBroker); boolean delete(
            final LogicalDatastoreType store, final InstanceIdentifier<D> path); boolean merge(
            final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data); boolean put(
            final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data); D read(final LogicalDatastoreType store,
            final InstanceIdentifier<D> path); boolean put(LogicalDatastoreType logicalDatastoreType, InstanceIdentifier<T> iid,
            T dataObject, FlowAction isAdd);  }
@Test public void testDelete() throws Exception { assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, instanceIdentifier)); verify(writeTransaction).delete(LogicalDatastoreType.CONFIGURATION, instanceIdentifier); verify(writeTransaction).submit(); when(checkedFuture.checkedGet()).thenThrow(TransactionCommitFailedException.class); assertFalse(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, instanceIdentifier)); verify(writeTransaction, times(2)).delete(LogicalDatastoreType.CONFIGURATION, instanceIdentifier); verify(writeTransaction, times(2)).submit(); }