historyStep = (Step) historySteps.get(historySteps.size() - 1);
historyStep = (Step) historySteps.get(0);
    public void testBasicGlobalAction() throws Exception {        URL url = getClass().getResource("/samples/global-actions.xml");        long id = workflow.initialize(url.toString(), 50, null);        int[] availableActions = workflow.getAvailableActions(id, null);        Object[] list = new Object[availableActions.length];        for (int i = 0; i < availableActions.length; i++) {            list[i] = new Integer(availableActions[i]);        }        assertTrue("Unexpected available actions " + Arrays.asList(list), Arrays.equals(new int[] {                    100, 101, 1                }, availableActions));        //verify that a global action can be called        workflow.doAction(id, 100, null);        List historySteps = workflow.getHistorySteps(id);        Step historyStep = (Step) historySteps.get(0);        assertEquals("Unexpected old status set", "Restarted", historyStep.getStatus());        //now let's move to step 2        workflow.doAction(id, 1, null);        //now test -1 stepId stuff.        workflow.doAction(id, 101, null);        historySteps = workflow.getHistorySteps(id);        historyStep = (Step) historySteps.get(historySteps.size() - 1);        assertEquals("Unexpected old status set", "Finished", historyStep.getStatus());    }