I don't recall if comments were made about this before or not, but if the import XML files had an error in specifying the name of another group, I suspect the set would be empty and this would throw a confusing NoSuchElementException.  If I'm right it would be better to catch the set was empty and throw a friendly error message that included the name so it would be easier to troubleshoot.