protected static int registerClass(int id, Class<? extends Identifiable> spec, Supplier<? extends Identifiable> creator) {
        if (registry == null) {
            registry = new Registry();
        }
        registry.add(id, spec, creator);
        return id;
    }
Registers the given class specification for the given identifier in the class registry. This method returns the
supplied identifier, so that subclasses can declare a static classId member like so:
<code>public static int classId = registerClass(&lt;id&gt;, &lt;ClassName&gt;.class);</code>

@param id   the class identifier to register with
@param spec the class to register
@return the identifier argument
vespajlib/src/main/java/com/yahoo/vespa/objects/Identifiable.java