### Question:
DBDeviceStateManager extends DBManager<DeviceState> implements DeviceStateManager { @Override public final List<DeviceState> getStates(final Device device) throws DeviceStateManagerException { LOGGER.debug("getting all states for device: {}", device); if (device == null) { LOGGER.error("null device argument"); throw new NullPointerException("null device"); } try { return super.getList(DeviceState.class); } catch (DBManagerException e) { throw new DeviceStateManagerException(e); } } DBDeviceStateManager(final SessionFactory sessionFactory); @Override final DeviceState saveState(final DeviceState state); @Override final DeviceState getState(final Device device, final Class<? extends DeviceState> clazz); @Override final List<DeviceState> getStates(final Device device); @Override final void updateState(final DeviceState state); @Override final boolean deleteState(final Device device, final Class<? extends DeviceState> clazz);  }### Answer:
@Test(expectedExceptions = NullPointerException.class) public void testGetListNull() { stateManager.getStates(null); }
@Test public void testGetListUnknown() { final List<DeviceState> states = stateManager.getStates(device); Assert.assertEquals(states.size(), 0); }