code: public List<List<String>> toGroups ()
      {
          List<String> list = Lists.newArrayList(_imports);
          Collections.sort(list, new Comparator<String>() {
              public int compare (String class1, String class2) {
                  return ComparisonChain.start()
                      .compare(findImportGroup(class1), findImportGroup(class2))
                      .compare(class1, class2)
                      .result();
              }
          });
          List<List<String>> result = Lists.newArrayList();
          List<String> current = null;
          int lastGroup = -2;
          for (String imp : list) {
              int group = findImportGroup(imp);
              if (group != lastGroup) {
                  if (current == null || !current.isEmpty()) {
                      result.add(current = Lists.<String>newArrayList());
                  }
                  lastGroup = group;
              }
              current.add(imp);
          }
          return result;
      }
docs: Converts the set of imports to groups of class names, according to conventional package
  ordering and spacing. Within each group, sorting is alphabetical.