docs: @NotNull
      public Map<String, Set<String>> getIndexNamesAndAliases(String indexPattern) {
          // only request indices matching the name or pattern in `indexPattern` and only get the alias names for each index,
          // not the settings or mappings
          final GetAliases request = new GetAliases.Builder()
                  .addIndex(indexPattern)
                  // ES 6 changed the "expand_wildcards" default value for the /_alias API from "open" to "all".
                  // Since our code expects only open indices to be returned, we have to explicitly set the parameter now.
                  .setParameter("expand_wildcards", "open")
                  .build();
  
          final JestResult jestResult = JestUtils.execute(jestClient, request, () -> "Couldn't collect aliases for index pattern " + indexPattern);
  
          final ImmutableMap.Builder<String, Set<String>> indexAliasesBuilder = ImmutableMap.builder();
          final Iterator<Map.Entry<String, JsonNode>> it = jestResult.getJsonObject().fields();
          while (it.hasNext()) {
              final Map.Entry<String, JsonNode> entry = it.next();
              final String indexName = entry.getKey();
              final JsonNode aliasMetaData = entry.getValue().path("aliases");
              if (aliasMetaData.isObject()) {
                  final ImmutableSet<String> aliasNames = ImmutableSet.copyOf(aliasMetaData.fieldNames());
                  indexAliasesBuilder.put(indexName, aliasNames);
              }
          }
  
          return indexAliasesBuilder.build();
      }