code: public static String[] toSortedArray(Set<String> groups) {
          //TODO: sort in another way than just alphabetically
          String[] sortedArray = groups.toArray(new String[groups.size()]);
  
          Arrays.sort(sortedArray);
  
          return sortedArray;
      }
docs: Alphabetically sort the list of groups
  
  @param groups List of available groups
  @return String[] of sorted groups