public MonitoringAnnotations build() {
      if (builderEntries == null) {
        throw new IllegalStateException("cannot call build() twice");
      }
      MonitoringAnnotations output =
          new MonitoringAnnotations(Collections.unmodifiableMap(this.builderEntries));
      // Collections.unmodifiableMap only gives an unmodifiable view of the underlying map.
      // To make output immutable, we have to remove the reference to it. This makes the builder
      // unusable afterwards.
      builderEntries = null;
      return output;
    }
Builds the MonitoringAnnotations object. The builder is not usable anymore afterwards.
java_src/src/main/java/com/google/crypto/tink/monitoring/MonitoringAnnotations.java