public NFA clone() {
        NFA res = new NFA();
        HashMap<State, State> tempMap = new HashMap<State, State>();
        for( String priKey : this.theTable.keySet() ) {
            for( State secKey : this.theTable.get( priKey ).keySet() ) {
                if( !tempMap.containsKey( secKey ) )
                    tempMap.put( secKey, new State(res) );
                for( State state : (HashSet<State>)this.theTable.get( priKey ).get( secKey ) ) {
                    if( !tempMap.containsKey( state ) )
                        tempMap.put( state, new State(res) );
                    try {
                        res.addTransition( tempMap.get( secKey ), priKey, tempMap.get( state ) );
                    } catch ( StateNotBelongsToFAException e ) {
                        System.err.println( "In Clone NFA: " + e.getMessage() );
                    }
                }
            }
        }
        res.setStartState( tempMap.get( this.startState ) );
        res.setFinalState( tempMap.get( this.finalState ) );
        return res;
    }