/** * Find the first {@link Class} that is annotated with the target annotation, starting * from the package defined by the given {@code source} up to the root. * @param source the source class to use to initiate the search * @return the first {@link Class} annotated with the target annotation within the * hierarchy defined by the given {@code source} or {@code null} if none is found. */ public Class<?> findFromClass(Class<?> source) { Assert.notNull(source, "Source must not be null"); return findFromPackage(ClassUtils.getPackageName(source)); }