Attempts to replicate DFAs and NFAs in Java