@Override
        protected int doHash(AnnotationValue value) {
          return value.accept(
              new SimpleAnnotationValueVisitor8<Integer, Void>() {
                @Override
                public Integer visitAnnotation(AnnotationMirror value, Void ignore) {
                  return AnnotationMirrors.equivalence().hash(value);
                }

                @SuppressWarnings("unchecked") // safe covariant cast
                @Override
                public Integer visitArray(List<? extends AnnotationValue> values, Void ignore) {
                  return AnnotationValues.equivalence()
                      .pairwise()
                      .hash((List<AnnotationValue>) values);
                }

                @Override
                public Integer visitType(TypeMirror value, Void ignore) {
                  return MoreTypes.equivalence().hash(value);
                }

                @Override
                protected Integer defaultAction(Object value, Void ignored) {
                  return value.hashCode();
                }
              },
              null);
        }
A utility class for working with {@link AnnotationValue} instances.

@author Christian Gruber
common/src/main/java/com/google/auto/common/AnnotationValues.java