code: public void calcOccurrences() {
          State state;
          Iterator iter;
          boolean changes;
  
          iter = states.iterator();
          while (iter.hasNext()) {
              state = (State) iter.next();
              state.minOcc = 1;
              state.maxOcc = 1;
          }
          do {
              // TODO: iterating in reverse order might be faster
              changes = false;
              iter = states.iterator();
              while (iter.hasNext()) {
                  state = (State) iter.next();
                  if (state.recalcOccurrence(this)) {
                      changes = true;
                  }
              }
          } while (changes);
      }
docs: TODO: nice and simple -- but it fails for recursion