### Question:
MdsalUtils { public <D extends DataObject> boolean delete( final LogicalDatastoreType store, final InstanceIdentifier<D> path) { boolean result = false; final WriteTransaction transaction = databroker.newWriteOnlyTransaction(); transaction.delete(store, path); FluentFuture<? extends CommitInfo> future = transaction.commit(); try { future.get(); result = true; } catch (InterruptedException | ExecutionException 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<? extends DataObject> path); Optional<D> readOptional(
            final LogicalDatastoreType store, final InstanceIdentifier<? extends DataObject> path); boolean exists(
        final LogicalDatastoreType store, final InstanceIdentifier<? extends DataObject> path);  }### Answer:
@Test public void testDelete() { WriteTransaction writeTransaction = mock(WriteTransaction.class); when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class)); verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); verify(writeTransaction, times(1)).commit(); assertTrue("Error, the delete transaction failed", result); }