code: public static Metadata from(UICommandMetadata origin, Class<? extends UICommand> type)
     {
        Assert.notNull(origin, "Parent UICommand must not be null.");
        Assert.notNull(type, "UICommand type must not be null.");
        Metadata metadata = new Metadata(type);
        metadata.docLocation(origin.getDocLocation()).name(origin.getName()).description(origin.getDescription())
                 .category(origin.getCategory());
        return metadata;
     }
docs: Create a new {@link UICommandMetadata} implementation from the given {@link UICommandMetadata} origin, and the
  given {@link UICommand} type.