@Test public void should_format_annotation() { AnnotationFormatter annotationFormatter = AnnotationFormatter.INSTANCE; PerfAnnotation1 perfAnnotation1 = new PerfAnnotation1() { @Override public Class<? extends Annotation> annotationType() { return PerfAnnotation1.class; } }; String formattedAnnotation = annotationFormatter.format(perfAnnotation1); assertThat(formattedAnnotation).isEqualTo("@PerfAnnotation1"); }
public String format(Annotation perfAnnotation) { return "@" + retrieveAnnotationNameOf(perfAnnotation) + formatParams(perfAnnotation); }
AnnotationFormatter { public String format(Annotation perfAnnotation) { return "@" + retrieveAnnotationNameOf(perfAnnotation) + formatParams(perfAnnotation); } }
AnnotationFormatter { public String format(Annotation perfAnnotation) { return "@" + retrieveAnnotationNameOf(perfAnnotation) + formatParams(perfAnnotation); } private  AnnotationFormatter(); }
AnnotationFormatter { public String format(Annotation perfAnnotation) { return "@" + retrieveAnnotationNameOf(perfAnnotation) + formatParams(perfAnnotation); } private  AnnotationFormatter(); String format(Annotation perfAnnotation); }
AnnotationFormatter { public String format(Annotation perfAnnotation) { return "@" + retrieveAnnotationNameOf(perfAnnotation) + formatParams(perfAnnotation); } private  AnnotationFormatter(); String format(Annotation perfAnnotation); static final AnnotationFormatter INSTANCE; }