public static String formatAnnotation(Annotation annotation) {
    String annotationName = annotation.annotationType().getName();
    String annotationNameWithoutPackage =
        annotationName.substring(annotationName.lastIndexOf('.') + 1).replace('$', '.');
    String annotationToString = annotation.toString();
    String values = annotationToString.substring(annotationToString.indexOf('('));
    return String.format("%s%s", annotationNameWithoutPackage, values);
  }
@Test
  public void testFormatAnnotationDefault() throws Exception {
    // Java 11 puts quotes in unparsed string, Java 8 does not.
    // It would be an improvement for our own formatter to make it have the
    // Java 11 behavior even when running on Java 8, but we can just
    // wait it out.
    assertThat(
        ReflectHelpers.formatAnnotation(Options.class.getMethod("getString").getAnnotations()[0]),
        anyOf(
            equalTo("Default.String(value=package.OuterClass$InnerClass#method())"),
            equalTo("Default.String(value=\"package.OuterClass$InnerClass#method()\")")));
  }