code: protected int findImportGroup (String imp)
      {
          int bestGroup = -1;
          int bestPrefixLength = -1;
          int ii = -1;
          for (String prefix : getImportGroups()) {
              ii++;
              if (!imp.startsWith(prefix)) {
                  continue;
              }
              if (prefix.length() > bestPrefixLength) {
                  bestPrefixLength = prefix.length();
                  bestGroup = ii;
              }
          }
          return bestGroup;
      }
docs: Find the index of the best import group to use for the specified import.