code: public UI wrap(Component component) {
          if (component instanceof UI) {
              return (UI) component;
          }
          if (component instanceof Window) {
              return wrapWindow((Window) component);
          }
          if (component instanceof Layout) {
              return wrapLayout((Layout) component);
          }
  
          // Ok it's a component we cannot handle directly
          final VerticalLayout layout = new VerticalLayout();
          layout.setMargin(true);
          layout.setSizeFull();
          layout.addComponent(component);
          layout.setExpandRatio(component, 1);
          return wrapLayout(layout);
      }
docs: Wraps the specified {@link Component} into a UI
  
  @param component the component to wrap
  @return an UI displaying that component
  @see #wrapLayout(com.vaadin.ui.Layout)