code: public void reduce(Character otherChar) {
          Set<Integer> seen = new HashSet<>();
          Queue<LevenshteinAutomatonState> q = new LinkedList<>();
          q.add(this);
  
          while (!q.isEmpty()) {
              LevenshteinAutomatonState s = q.poll();
              if (seen.contains(System.identityHashCode(s)))
                  continue;
  
              LevenshteinAutomatonState otherTo = s.transitions.get(otherChar);
              if (otherTo == null) {
                  // There is no reduction possible in this state: queue the to-states, mark this state
                  // as seen and continue with the next state.
                  for (LevenshteinAutomatonState toState : s.transitions.values())
                      q.add(toState);
  
                  seen.add(System.identityHashCode(s));
  
                  continue;
              }
  
              // Find transitions that can be removed, because they are handled by an 'other' transition. This
              // is the case when a transition is not the 'other' transition, but has the same to-state as the
              // 'other' transition.
              Set<Character> remove = new HashSet<>();
              for (Entry<Character, LevenshteinAutomatonState> trans : s.transitions.entrySet())
                  if (!trans.getKey().equals(otherChar) && trans.getValue() == otherTo)
                      remove.add(trans.getKey());
  
              // Remove the transitions that were found.
              for (Character c : remove)
                  s.transitions.remove(c);
  
              // Recompute the hash if the state table has changed.
              if (remove.size() != 0)
                  s.d_recomputeHash = true;
  
              // We have now seen this state.
              seen.add(System.identityHashCode(s));
  
              // Queue states that can be reached via this state.
              for (LevenshteinAutomatonState toState : s.transitions.values())
                  q.add(toState);
          }
      }
docs: Reduce the set of outgoing transitions by removing transitions that are also captured by the
  'other'-transition. The 'other'-transition are transitions with the given character.
  
  @param otherChar The character representing any other character.