code: private void checkHead(Token token, Optional<Integer> optHead) {
          if (optHead.isPresent()) {
              int head = optHead.get();
              Preconditions.checkArgument(head >= 0 && head <= tokens.size(), String.format("Head should refer to token or 0: %s", token));
          }
      }
docs: Check that the head is connected.
  @param optHead