code: public static Optional<Map<String, Set<String>>> getLocalityGroups(Map<String, Object> tableProperties)
      {
          requireNonNull(tableProperties);
  
          @SuppressWarnings("unchecked")
          String groupStr = (String) tableProperties.get(LOCALITY_GROUPS);
          if (groupStr == null) {
              return Optional.empty();
          }
  
          ImmutableMap.Builder<String, Set<String>> groups = ImmutableMap.builder();
  
          // Split all configured locality groups
          for (String group : PIPE_SPLITTER.split(groupStr)) {
              String[] locGroups = Iterables.toArray(COLON_SPLITTER.split(group), String.class);
  
              if (locGroups.length != 2) {
                  throw new PrestoException(INVALID_TABLE_PROPERTY, "Locality groups string is malformed. See documentation for proper format.");
              }
  
              String grpName = locGroups[0];
              ImmutableSet.Builder<String> colSet = ImmutableSet.builder();
  
              for (String f : COMMA_SPLITTER.split(locGroups[1])) {
                  colSet.add(f.toLowerCase(Locale.ENGLISH));
              }
  
              groups.put(grpName.toLowerCase(Locale.ENGLISH), colSet.build());
          }
  
          return Optional.of(groups.build());
      }
docs: Gets the configured locality groups for the table, or Optional.empty() if not set.
  <p>
  All strings are lowercase.
  
  @param tableProperties The map of table properties
  @return Optional map of locality groups