public void register(AnnotationType type) {
        if (idMap.containsKey(type.getId()) || nameMap.containsKey(type.getName())) {
            AnnotationType idType = idMap.get(type.getId());
            AnnotationType nameType = nameMap.get(type.getName());
            if (type.equals(idType) && type.equals(nameType)) {
                //it's the same one being re-registered, we're OK!
                return;
            }
            throw new IllegalArgumentException("A type is already registered with this name or this id.");
        }
        idMap.put(type.getId(), type);
        nameMap.put(type.getName(), type);
    }
Register a new annotation type.
WARNING! Only to be used by the configuration system and in unit tests. Not to be used in production code.

@param type the type to register
@throws IllegalArgumentException if a type is already registered with this name or this id, and it is non-equal to the argument.
document/src/main/java/com/yahoo/document/annotation/AnnotationTypeRegistry.java