private static Item create(ItemSpec<?> spec, Path path) { checkNotNull(spec, "spec cannot be null"); checkNotNull(path, "path cannot be null"); Class<?> ns = checkNotNull(spec.getNamespace(), "namespace must be set"); return new AutoValue_DisplayData_Item( path, ns, spec.getKey(), spec.getType(), spec.getValue(), spec.getShortValue(), spec.getLabel(), spec.getLinkUrl()); }