code: public static Map<String, Set<Text>> getLocalityGroups(AccumuloTable table)
      {
          Map<String, Set<Text>> groups = new HashMap<>();
          // For each indexed column
          for (AccumuloColumnHandle columnHandle : table.getColumns().stream().filter(AccumuloColumnHandle::isIndexed).collect(Collectors.toList())) {
              // Create a Text version of the index column family
              Text indexColumnFamily = new Text(getIndexColumnFamily(columnHandle.getFamily().get().getBytes(UTF_8), columnHandle.getQualifier().get().getBytes(UTF_8)).array());
  
              // Add this to the locality groups,
              // it is a 1:1 mapping of locality group to column families
              groups.put(indexColumnFamily.toString(), ImmutableSet.of(indexColumnFamily));
          }
          return groups;
      }
docs: Gets a set of locality groups that should be added to the index table (not the metrics table).
  
  @param table Table for the locality groups, see AccumuloClient#getTable
  @return Mapping of locality group to column families in the locality group, 1:1 mapping in
  this case