Good feedback, thanks!
can we put the exit condition into the while block instead of at the end with a break I think it can just be while(string.length > 0)
looking at the impl of State I think we can just use an identity hashset or maybe even an array since the Ids are within known bounds to check the pathStates? You could even just us a bitset and mark the state ID as visited? Hmm now that I wrote it I see your comment I will leave it here for dicsussion.
I switched to IdentityHashSet.
Yeah I struggled w/ this, but the original method didn't set the state
numbers so I didn't want to change that. Setting the numbers does a
DFS on the automaton...
Somewhat unrelated but I think the State implementation has a problem since it doen't override equlas but it should since it has an hashcode impl. I wonder if we either should remove the hashCode or add equals just for consistency?
I removed State.hashCode.
should we rather throw IllegalState than IllegalArgument
Hmm, IAE felt right since you passed it an invalid (cyclic) argument?
just for readability it might be good to s/strings/finiteStrings/ I had a hard time to see when you do things on the string vs. strings
I changed to results.
is this a leftover ==> // a.getNumberedStates();