@Test
public void testStateTransitions() {

	try {
		// release immediately
		{
			SimpleSlot slot = getSlot();
			assertTrue(slot.isAlive());
			slot.releaseSlot();
			assertFalse(slot.isAlive());
			assertTrue(slot.isCanceled());
			assertTrue(slot.isReleased());
		}
		// state transitions manually
		{
			SimpleSlot slot = getSlot();
			assertTrue(slot.isAlive());
			slot.markCancelled();
			assertFalse(slot.isAlive());
			assertTrue(slot.isCanceled());
			assertFalse(slot.isReleased());
			slot.markReleased();
			assertFalse(slot.isAlive());
			assertTrue(slot.isCanceled());
			assertTrue(slot.isReleased());
		}
	}
	catch (Exception e) {
		e.printStackTrace();
		fail(e.getMessage());
	}
}