code: public static Inode wrap(InodeView delegate) {
      if (delegate instanceof Inode) {
        return (Inode) delegate;
      }
      if (delegate.isFile()) {
        Preconditions.checkState(delegate instanceof InodeFileView);
        return new InodeFile((InodeFileView) delegate);
      } else {
        Preconditions.checkState(delegate instanceof InodeDirectoryView);
        return new InodeDirectory((InodeDirectoryView) delegate);
      }
    }
docs: Wraps an InodeView, providing read-only access. Modifications to the underlying inode will
  affect the created read-only inode.
  
  @param delegate the delegate to wrap
  @return the created read-only inode