code: public @Nonnull Object getRoot() {
      Chain current = this;
      while (current.hasParent()) {
        current = current.getParent();
      }
      return current.getValue();
    }
docs: Returns the root object of this chain.