code: public synchronized Word<O> getOutput(final Word<I> query) {
          if (query == null) {
              String msg = "Query is not allowed to be null.";
              throw new IllegalArgumentException(msg);
          }
  
          final WordBuilder<O> output = new WordBuilder<>();
  
          ReuseNode<S, I, O> sink = getRoot();
          for (final I symbol : query) {
              final ReuseEdge<S, I, O> edge = sink.getEdgeWithInput(alphabet.getSymbolIndex(symbol));
              if (edge == null) {
                  return null;
              }
              output.add(edge.getOutput());
              sink = edge.getTarget();
          }
  
          return output.toWord();
      }
docs: Returns the known output for the given query or {@code null} if not known.
  
  @param query
  Not allowed to be {@code null}.
  
  @return The output for {@code query} if already known from the {@link ReuseTree} or {@code null} if unknown.