public void setScratchId(int id) {
        scratchId = id;
    }
This scratch id is used to avoid using IdentityHashMaps as they are very costly.
document/src/main/java/com/yahoo/document/annotation/Annotation.java