ReflectionUtil { public static Optional<Object> parse(Type type, String serialized) { return Optional.ofNullable(PARSER_MAP.get(type)) .map(m -> m.apply(serialized)); } private  ReflectionUtil(); static Stream<Field> traverseFields(Class<?> clazz); static Stream<Method> traverseMethods(Class<?> clazz); static Stream<Class<?>> traverseAncestors(Class<?> clazz); static MissingArgumentStrategy missingArgumentStrategy(Executable executable); static Optional<T> tryToCreate(Class<T> clazz, Properties properties, List<Object> instances, Set<Class<?>> allInjectableTypes, InjectorProxy injectorProxy); @SuppressWarnings("unchecked") static String errorMsg(Class<T> c, List<Object> instances); static Optional<Object> parse(Type type, String serialized);  }
@Test void parseChar() { assertEquals('A', ReflectionUtil.parse(Character.class, "A").orElseThrow(NoSuchElementException::new)); }
@Test void parseCharLarge() { assertThrows(IllegalArgumentException.class, () -> ReflectionUtil.parse(Character.class, "AB").orElseThrow(NoSuchElementException::new)); }