ReflectionUtil { public static Stream<Method> traverseMethods(Class<?> clazz) { return traverseAncestors(clazz) .flatMap(c -> Stream.of(c.getDeclaredMethods())); } 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 traverseMethods() { final Set<String> methodNames = Stream.of("foo", "bar").collect(toSet()); final List<Method> methods = ReflectionUtil.traverseMethods(Bar.class) .filter(m -> methodNames.contains(m.getName())) .collect(toList()); assertEquals(2, methods.size(), methods.toString()); }