code: private MethodSymbol validateContainer(Type targetContainerType,
                                             Type originalAnnoType,
                                             DiagnosticPosition pos) {
          MethodSymbol containerValueSymbol = null;
          boolean fatalError = false;
  
          // Validate that there is a (and only 1) value method
          Scope scope = targetContainerType.tsym.members();
          int nr_value_elems = 0;
          boolean error = false;
          for(Symbol elm : scope.getSymbolsByName(names.value)) {
              nr_value_elems++;
  
              if (nr_value_elems == 1 &&
                      elm.kind == MTH) {
                  containerValueSymbol = (MethodSymbol)elm;
              } else {
                  error = true;
              }
          }
          if (error) {
              log.error(pos,
                      "invalid.repeatable.annotation.multiple.values",
                      targetContainerType,
                      nr_value_elems);
              return null;
          } else if (nr_value_elems == 0) {
              log.error(pos,
                      "invalid.repeatable.annotation.no.value",
                      targetContainerType);
              return null;
          }
  
          // validate that the 'value' element is a method
          // probably "impossible" to fail this
          if (containerValueSymbol.kind != MTH) {
              log.error(pos,
                      "invalid.repeatable.annotation.invalid.value",
                      targetContainerType);
              fatalError = true;
          }
  
          // validate that the 'value' element has the correct return type
          // i.e. array of original anno
          Type valueRetType = containerValueSymbol.type.getReturnType();
          Type expectedType = types.makeArrayType(originalAnnoType);
          if (!(types.isArray(valueRetType) &&
                  types.isSameType(expectedType, valueRetType))) {
              log.error(pos,
                      "invalid.repeatable.annotation.value.return",
                      targetContainerType,
                      valueRetType,
                      expectedType);
              fatalError = true;
          }
  
          return fatalError ? null : containerValueSymbol;
      }
docs: /* Validate that the suggested targetContainerType Type is a valid
  container type for repeated instances of originalAnnoType
  annotations. Return null and report errors if this is not the
  case, return the MethodSymbol of the value element in
  targetContainerType if it is suitable (this is needed to
  synthesize the container).