private static Stream<Class<?>> getClasses(final Class<?> parent) {
		final var type = new AtomicReference<Class<?>>(parent);

		final Supplier<Class<?>> supplier = () -> {
			final var next = type.get();
			if (next != null) {
				type.set(next.getSuperclass());
			}
			return next;
		};

		return Stream.generate(supplier).takeWhile(Objects::nonNull);
	}
Return all annotations of the given method, inclusively the inherited one.

@param method the method for which to fetch the annotations
@return all annotations of the given method
jenetics.incubator/src/main/java/io/jenetics/incubator/beans/internal/Reflect.java