@Override
  public final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    Messager messager = processingEnv.getMessager();
    TypeElement memoized = processingEnv.getElementUtils().getTypeElement(MEMOIZED_NAME);
    for (ExecutableElement method : methodsIn(roundEnv.getElementsAnnotatedWith(memoized))) {
      if (!isAutoValue(method.getEnclosingElement())) {
        messager.printMessage(
            ERROR,
            "@Memoized methods must be declared only in @AutoValue classes",
            method,
            getAnnotationMirror(method, MEMOIZED_NAME).get());
      }
    }
    return false;
  }
An annotation {@link Processor} that reports errors for {@code @Memoized} methods that are not
inside {@code AutoValue}-annotated classes.
value/src/main/java/com/google/auto/value/extension/memoized/processor/MemoizedValidator.java