protected void initializePending() {
        AppState[] array = getInitializing();
        if (array.length == 0)
            return;

        synchronized (states) {
            // Move the states that will be initialized
            // into the active array.  In all but one case the
            // order doesn't matter but if we do this here then
            // a state can detach itself in initialize().  If we
            // did it after then it couldn't.
            List<AppState> transfer = Arrays.asList(array);
            states.addAll(transfer);
            initializing.removeAll(transfer);
        }
        for (AppState state : array) {
            state.initialize(this, app);
        }
    }
Returns the state associated with the specified ID at the time it
 was attached or throws an IllegalArgumentException if the ID was
 not found.

@param <T> the desired type of AppState
@param id the AppState ID
@param stateClass the desired type of AppState
@return the pre-existing instance (not null)
jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java