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