private StateNFA CreateState(int leftNonTerminalSymbol, List<Integer> rightSymbols, Boolean isInitial, int itemDotIndex, List<Integer> b_set, int productionIndex){
		// States are actually items from the productions from the grammar. 
		StateNFA s = new StateNFA();
		s.mIsInitial = isInitial;
		s.mItem = new Item();
		s.mItem.mLeftNonTerminalSymbolIndex = leftNonTerminalSymbol;
		s.mItem.mItemDotPosition = itemDotIndex;
		s.mItem.mProductionIndex = productionIndex;
		// copy mRightSymbols array
		for (int i = 0; i < rightSymbols.size(); ++i){
			s.mItem.mRightSymbolsIndices.add(rightSymbols.get(i));
		}
		if (s.mItem.mRightSymbolsIndices.size() == 1 && // epsilon productions have s.mItem.mRightSymbolsIndices.size == 0
				s.mItem.mRightSymbolsIndices.get(0) == Utilities.ProductionEpsilonCode) 
			s.mItem.mRightSymbolsIndices.clear();
		// copy mBEGINS_Set array
		for (int i = 0; i < b_set.size(); ++i){
			s.mItem.mBEGINS_Set.add(b_set.get(i));
		}
		
		s.mUsed = isInitial;
		s.mUsedInNextStep = false;
		return s;
	}