code: protected Set<AnnotationPair> buildAnnotationPairs(
              ProtoNetwork protoNetwork,
              Map<String, Annotation> annotationMap) {
          // build annotation value to annotation definition map
          Set<AnnotationPair> valueDefinitions =
                  new LinkedHashSet<AnnotationPair>();
          AnnotationValueTable avt = protoNetwork.getAnnotationValueTable();
          AnnotationDefinitionTable adt =
                  protoNetwork.getAnnotationDefinitionTable();
  
          Set<Annotation> annotationMapValues = new HashSet<Annotation>(
                  annotationMap.values());
          for (Annotation a : annotationMapValues) {
              int adid =
                      adt.getDefinitionIndex().get(
                              new TableAnnotationDefinition(a.getDefinition()));
              int aid = avt.addAnnotationValue(adid, a.getValue());
              valueDefinitions.add(new AnnotationPair(adid, aid));
          }
  
          return valueDefinitions;
      }
docs: Build a {@link Set} of {@link AnnotationPair} objects from a {@link Map}
  of {@link Annotation} values.
  
  @param protoNetwork {@link ProtoNetwork}, the proto network
  @param annotationMap {@link Map}, the annotations map
  @return {@link Set}, the {@link Set} of annotation definition and value
  pairs