@Override
    public void simpleUpdate(float tpf) {
    
        if(stateManager.getState(TestState.class) != null) {
            System.out.println("Detaching test state."); 
            stateManager.detach(stateManager.getState(TestState.class));
            System.out.println("Done"); 
        }
        
        if( stateManager.hasState("Test ID") ) {
            System.out.println("Detaching test state with an ID."); 
            stateManager.detach(stateManager.getState("Test ID", TestState.class));
            System.out.println("Done"); 
        }
    }
Tests the app state lifecycles.

 @author    Paul Speed
jme3-examples/src/main/java/jme3test/app/TestAppStateLifeCycle.java