added getState function to WorkItem class to avoid direct state access
added tests and implementation for WorkItem.allowedTransitions()