question: public synchronized static int insertLuaState ( LuaState L ) { int i ; for ( i = 0 ; i < states . size ( ) ; i ++ ) { LuaState state = ( LuaState ) states . get ( i ) ; if ( state != null ) { if ( state . getCPtrPeer ( ) == L . getCPtrPeer ( ) ) return i ; } } i = getNextStateIndex ( ) ; states . set ( i , L ) ; return i ; }
target:  Receives a existing LuaState and checks if it exists in the states list. If it doesn't exist adds it to the list.