code: public synchronized ReuseNode.NodeResult<S, I, O> fetchSystemState(Word<I> query) {
          if (query == null) {
              String msg = "Query is not allowed to be null.";
              throw new IllegalArgumentException(msg);
          }
  
          int length = 0;
  
          ReuseNode<S, I, O> sink = getRoot();
          ReuseNode<S, I, O> lastState = null;
          if (sink.hasSystemStates()) {
              lastState = sink;
          }
  
          ReuseNode<S, I, O> node;
          for (int i = 0; i < query.size(); i++) {
              node = sink.getTargetNodeForInput(alphabet.getSymbolIndex(query.getSymbol(i)));
  
              if (node == null) {
                  // we have reached longest known prefix
                  break;
              }
  
              sink = node;
              if (sink.hasSystemStates()) {
                  lastState = sink;
                  length = i + 1;
              }
          }
  
          if (lastState == null) {
              return null;
          }
  
          S systemState = lastState.fetchSystemState(invalidateSystemstates);
  
          return new ReuseNode.NodeResult<>(lastState, systemState, length);
      }
docs: Returns a reuseable {@link ReuseNode.NodeResult} with system state or {@code null} if none such exists. If
  ''oldInvalidated'' was set to {@code true} (in the {@link ReuseOracle}) the system state is already removed from
  the tree whenever one was available.
  
  @param query
  Not allowed to be {@code null}.