private HashSet<State> eClosure( NFA nfa, State state ) {
        HashSet<State> set = new HashSet<State>(); // Create a set to put epsilon closure states into.
        Queue<State> queue = new LinkedList<State>(  ); // A queue to track epsilon transactions

        set.add( state ); // Add given state into set
        queue.add( state ); // Add given state in queue

        while( !queue.isEmpty() ) { // While there is state to calculate epsilon closure for
            try {
                for ( State st : nfa.getNextState( queue.poll(), "\0" ) ) { // For each state in epsilon transition set for the state in head of queue
                    if ( !set.contains( st ) ) { // If set not contains that state
                        set.add( st ); // Add the state into set
                        queue.add( st ); // Add the state into queue
                    }
                }
            } catch ( TransitionNotFoundException e ) {
                // Do noting
            }
        }

        return set; // Return epsilon closure set
    }