code: private String newID(Iterator<String> iter, String start) {
          int highest = 0;
          if (iter != null) {
              while (iter.hasNext()) {
                  String id = iter.next();
                  if (id.startsWith(start) && id.length() > start.length()) {
                      try {
                          int num = Integer.parseInt(id.substring(start.length()));
                          if (num > highest) {
                              highest = num;
                          }
                      } catch (NumberFormatException ignored) {
                      }
                  }
              }
          }
          int newNum = highest + 1;
          return start + newNum;
      }
docs: Given an iterator of existing ids, return a new id that starts with
  <code>start</code> and is guaranteed to be unique. This algorithm adds
  one to the highest existing id that starts with <code>start</code>. If
  no such existing id exists, it will return <i>start</i> + "1".