ReflectionUtil { public static Stream<Field> traverseFields(Class<?> clazz) { final Class<?> parent = clazz.getSuperclass(); final Stream<Field> inherited; if (parent != null) { inherited = traverseFields(parent); } else { inherited = Stream.empty(); } return Stream.concat(inherited, Stream.of(clazz.getDeclaredFields())); } 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 traverseFields() throws NoSuchFieldException { final List<Field> fields = ReflectionUtil.traverseFields(Bar.class) .filter(f -> !f.getName().contains("jacocoData")) .collect(toList()); assertEquals(2, fields.size(), fields.toString()); }