this.processContext.enterState( this.state1 );  assertSame( this.state1, this.processContext.getCurrentState() );  try { this.processContext.enterState( this.state2 ); fail( "Should have thrown InvalidMotionException" ); } catch (InvalidMotionException e) {  }
this.processContext.enterState( this.state2 ); fail( "Should have thrown InvalidMotionException" );
    public void testEnterState_Invalid_NotExitedOtherState()    {        this.processContext.startProcess( this.process );        assertSame( this.process,                    this.processContext.getCurrentProcess() );        assertNull( this.processContext.getCurrentState() );        try        {            this.processContext.enterState( this.state1 );            assertSame( this.state1,                        this.processContext.getCurrentState() );            try            {                this.processContext.enterState( this.state2 );                fail( "Should have thrown InvalidMotionException" );            }            catch (InvalidMotionException e)            {                // expected and correct            }        }        catch (InvalidMotionException e)        {            fail( e.getLocalizedMessage() );        }    }     