### Question:
DBDeviceManager extends DBManager<Device> implements
        DeviceManager { @Override public final boolean deleteDevice(final String name) throws DeviceManagerException { LOGGER.debug("deleting device: {}", name); try { return super.delete(name); } catch (DBManagerException e) { throw new DeviceManagerException(e); } } DBDeviceManager(final SessionFactory sessionFactory); @Override final Device saveDevice(final Device device); @Override final void updateDevice(final Device device); @Override final void updateDeviceList(final Set<Device> deviceList); @Override final Set<Device> getDeviceList(); @Override final List<String> getDeviceNameList(); @Override final FilteredRecordsList<Device> getOrderedDeviceList(
            final String columnToOrder, final boolean ascending, final int firstResult,
            final int maxResults, final String search); @Override final Device getDevice(final String name); @Override final List<Device> getDefaultDevices(); @Override final boolean deleteDevice(final String name);  }### Answer:
@Test public void testDeleteDevice() throws Exception { LOGGER.debug("testDeleteDevice"); Assert.assertEquals(DBUtility.getCount(sessionFactory, Device.class), 0); final Device device = new Device(deviceName); final DeviceManager mgr = new DBDeviceManager(sessionFactory); final DeviceGroup group = createGroup(DeviceGroup.DEFAULT_GROUP); device.setDeviceGroup(group); final Device savedDevice = mgr.saveDevice(device); Assert.assertEquals(DBUtility.getCount(sessionFactory, Device.class), 1); Assert.assertTrue(DBUtility.isInDatabase(sessionFactory, Device.class, deviceName)); final UUID deviceID = savedDevice.getId(); Assert.assertNotNull(deviceID); boolean deleteSuccessful = mgr.deleteDevice(deviceName); Assert.assertTrue(deleteSuccessful); Assert.assertFalse( DBUtility.isInDatabase(sessionFactory, DeviceGroup.class, deviceName) ); }