code: public void reduce(Direction defaultDirection) {
          List<StorableIndex<S>> group = new ArrayList<StorableIndex<S>>();
          Map<StorableIndex<S>, StorableIndex<S>> mergedReplacements =
              new TreeMap<StorableIndex<S>, StorableIndex<S>>(STORABLE_INDEX_COMPARATOR);
  
          Iterator<StorableIndex<S>> it = iterator();
          while (it.hasNext()) {
              StorableIndex<S> candidate = it.next();
  
              if (group.size() == 0 || isDifferentGroup(group.get(0), candidate)) {
                  group.clear();
                  group.add(candidate);
                  continue;
              }
  
              if (isRedundant(group, candidate, mergedReplacements)) {
                  it.remove();
              } else {
                  group.add(candidate);
              }
          }
  
          // Now replace merged indexes.
          replaceEntries(mergedReplacements);
  
          setDefaultDirection(defaultDirection);
      }
docs: Reduces the size of the set by removing redundant indexes, and merges
  others together.
  
  @param defaultDirection replace unspecified property directions with this