text: public static int getSingleViableAlt(Collection<BitSet> altsets) {BitSet viableAlts = new BitSet();for (BitSet alts : altsets) {int minAlt = alts.nextSetBit(0);viableAlts.set(minAlt);if ( viableAlts.cardinality()>1 ) { return ATN.INVALID_ALT_NUMBER;}}return viableAlts.nextSetBit(0);}