public boolean unregister(AnnotationType type) {
        if (idMap.containsKey(type.getId()) && nameMap.containsKey(type.getName())) {
            AnnotationType idType = idMap.get(type.getId());
            AnnotationType nameType = nameMap.get(type.getName());

            if (idType == nameType) {
                //name and id belong together in our maps
                idMap.remove(type.getId());
                nameMap.remove(type.getName());
            } else {
                throw new IllegalArgumentException("The ID and name of this annotation type are present, " +
                                                   "but they do not belong together. Not removing type.");
            }
            return true;
        }
        // It's not there, but that's no problem
        return false;
    }
Unregisters the type given by the argument.
WARNING! Only to be used by the configuration system and in unit tests. Not to be used in production code.

@param type the AnnotationType to unregister
@return true if the type was successfully unregistered, false otherwise (it was not present)
@throws IllegalArgumentException if the ID and name of this annotation type are present,
                                 but they do not belong together.
document/src/main/java/com/yahoo/document/annotation/AnnotationTypeRegistry.java