ReflectHelpers { 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); }  static String formatMethod(Method input); static String formatMethodWithClass(Method input); static String formatAnnotation(Annotation annotation); static String simpleTypeDescription(Type input); static Iterable<Method> getClosureOfMethodsOnInterfaces(
      Iterable<? extends Class<?>> interfaces); static Iterable<Method> getClosureOfMethodsOnInterface(Class<?> iface); static Iterable<T> loadServicesOrdered(Class<T> iface, ClassLoader classLoader); static Iterable<T> loadServicesOrdered(Class<T> iface); static ClassLoader findClassLoader(final ClassLoader proposed); static ClassLoader findClassLoader(final Class<?>... classes); static ClassLoader findClassLoader();  }
@Test public void testFormatAnnotationDefault() throws Exception { 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()\")"))); }
@Test public void testFormatAnnotationJsonIgnore() throws Exception { assertEquals( "JsonIgnore(value=true)", ReflectHelpers.formatAnnotation(Options.class.getMethod("getObject").getAnnotations()[0])); }