public static Set<String> buildStringIndex(Collection<? extends ElementPattern<?>> patterns) {
    final Set<String> result = new HashSet<>();
    processStringValues(patterns, (elementPattern, value) -> {
      for (Object o : value) {
        if (o instanceof String) {
          result.add((String)o);
        }
      }
      return true;
    });
    return result;
  }
public static Set<String> buildStringIndex(Collection<? extends ElementPattern<?>> patterns)