### Question:
DBDeviceManager extends DBManager<Device> implements
        DeviceManager { @Override public final List<String> getDeviceNameList() throws DeviceManagerException { LOGGER.debug("getting device list"); List<String> deviceNames = new LinkedList<>(); try { final List<Device> devices = super.getList(Device.class); for (Device b : devices) { deviceNames.add(b.getName()); } } catch (DBManagerException e) { throw new DeviceManagerException(e); } return deviceNames; } 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 testGetDeviceNameList() throws Exception { LOGGER.debug("testGetDeviceNameList test started"); final DeviceManager mgr = new DBDeviceManager(sessionFactory); final String[] names = {"Device1", "Device2", "Device3", "Device4"}; final List<String> namesList = new LinkedList<>(); final DeviceGroup group = createGroup(DeviceGroup.DEFAULT_GROUP); for (String name : names) { final Device device = DeviceTest.getTestDevice(name); device.setDeviceGroup(group); mgr.saveDevice(device); namesList.add(name); } final List<String> dbNames = mgr.getDeviceNameList(); Collections.sort(dbNames); Assert.assertEquals(dbNames, namesList); }
@Test public void testGetDeviceNameListEmpty() { LOGGER.debug("testGetDeviceNameListEmpty test started"); final DeviceManager mgr = new DBDeviceManager(sessionFactory); final List<String> namesList = new LinkedList<>(); final List<String> dbNames = mgr.getDeviceNameList(); Assert.assertEquals(dbNames, namesList); }