assertEquals("Transition", Transitions.Stopped, flow.getState().get());  assertTrue("Flow should be stopped but is: " + flow.getState().get(), flow.isStopped()); assertTrue("Flow should not have failed", !flow.isFailed());
assertFlowStopped(flow);
    public void testFlowStopsSuccessfully() throws Exception {        flow.getState().set(Transitions.Stopped);                assertEquals("Transition", Transitions.Stopped, flow.getState().get());                assertTrue("Flow should be stopped but is: " + flow.getState().get(), flow.isStopped());        assertTrue("Flow should not have failed", !flow.isFailed());                // lets sleep so that the timer can go off now to check we don't fail after we've stopped        Thread.sleep(timeout  * 4);                assertEquals("Transition", Transitions.Stopped, flow.getState().get());                assertTrue("Flow should be stopped but is: " + flow.getState().get(), flow.isStopped());        assertTrue("Flow should not have failed", !flow.isFailed());    }