### Question:
FormatHelper { public static Optional<TransformInfo> getFormat(Type type, Annotations annotations) { if (Classes.isDateLikeTypeOrCollectionThereOf(type)) { return getDateFormat(annotations); } else if (Classes.isNumberLikeTypeOrCollectionThereOf(type)) { return getNumberFormat(annotations); } return Optional.empty(); } private  FormatHelper(); static boolean hasAnyFormatting(Annotations annotations); static Optional<TransformInfo> getFormat(Type type, Annotations annotations); static Optional<String> getNumberFormatString(Annotations annotations); static String getDateFormatString(Annotations annotations, Type type);  }### Answer:
@Test public void testFormattedLocalDate() throws Exception { Index complete = IndexCreator.index(AsyncApi.class); ClassInfo classByName = complete.getClassByName(DotName.createSimple(AsyncApi.class.getName())); MethodInfo nonNullString = classByName.method("formattedLocalDate"); Type type = nonNullString.returnType(); Annotations annotations = Annotations.getAnnotationsForMethod(nonNullString); Optional<TransformInfo> format = FormatHelper.getFormat(type, annotations); TransformInfo transformInfo = format.get(); assertEquals("yyyy-MM-dd", transformInfo.getFormat()); }
@Test public void testFormattedCompletionStage() throws Exception { Index complete = IndexCreator.index(AsyncApi.class); ClassInfo classByName = complete.getClassByName(DotName.createSimple(AsyncApi.class.getName())); MethodInfo nonNullString = classByName.method("formattedCompletionStage"); Type type = nonNullString.returnType(); Annotations annotations = Annotations.getAnnotationsForMethod(nonNullString); Optional<TransformInfo> format = FormatHelper.getFormat(type, annotations); TransformInfo transformInfo = format.get(); assertEquals("yyyy-MM-dd", transformInfo.getFormat()); }