public boolean hasSingleFinalState(Automaton automaton) {
		State[] finalStates = automaton.getFinalStates();
		if (finalStates.length != 1) {
			// System.err.println("There is not exactly one final state!");
			return false;
		}

		State finalState = finalStates[0];
		Transition[] transitions = automaton.getTransitionsToState(finalState);
		for (int k = 0; k < transitions.length; k++) {
			PDATransition trans = (PDATransition) transitions[k];
			String toPop = trans.getStringToPop();
			if (!(toPop.substring(toPop.length() - 1)).equals(BOTTOM_OF_STACK)) {
				// System.err.println("Bad transition to final state! "+trans);
				// System.err.println(toPop.substring(toPop.length()-1));
				return false;
			}
		}
		return true;
	}