### Question:
DBIMADeviceStateManager extends DBDeviceStateManager implements IMADeviceStateManager { @Override public final boolean deleteState(final Device device) throws IMADeviceStateManagerException { try { return super.deleteState(device, IMADeviceState.class); } catch (DeviceStateManagerException e) { throw new IMADeviceStateManagerException(e); } } DBIMADeviceStateManager(final SessionFactory factory); @Override final IMADeviceState saveState(final IMADeviceState state); @Override final IMADeviceState getState(final Device device); @Override final void updateState(final IMADeviceState state); @Override final boolean deleteState(final Device device);  }### Answer:
@Test public void testDeleteUnknown() { Assert.assertEquals(DBUtility.getCount(sessionFactory, IMADeviceState.class), 0); final boolean deleted = stateManager.deleteState(device); Assert.assertFalse(deleted); Assert.assertEquals(DBUtility.getCount(sessionFactory, IMADeviceState.class), 0); }
@Test(expectedExceptions = NullPointerException.class) public void testDeleteNull() { Assert.assertEquals(DBUtility.getCount(sessionFactory, IMADeviceState.class), 0); stateManager.deleteState(null); }