package com.wccgroup.coloja;

import static org.junit.Assert.assertThat;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.reflections.Reflections;
import org.reflections.scanners.SubTypesScanner;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class LombokValidator
{
	public static List<Class> autoValidate(String namespacePrefix)
	{
		List<Class> validatedClasses = new ArrayList<>();

		for (String className : new Reflections(namespacePrefix, new SubTypesScanner(false)).getAllTypes())
		{
			Class<?> classDefinition;

			try
			{
				classDefinition = Heuristics.isLombokGeneratedObject(className);
			}
			catch (ClassNotFoundException | NoClassDefFoundError e)
			{
				log.debug("Not validating '" + className + "' because the class could not be loaded: " + e.getMessage(), e);
				continue;
			}

			if (classDefinition != null)
			{
				try
				{
					log.info("Validating '{}' because it appears to be a lombok object.", className);
					validate(classDefinition);
					validatedClasses.add(classDefinition);
				}
				catch (NoSuchMethodException | InstantiationException | IllegalAccessException
					| InvocationTargetException e)
				{
					log.warn("Failure", e);
					org.junit.Assert.fail("Could not validate type '" + className + "' as being a valid Lombok object");
				}
			}
			else
			{
				log.debug("Not validating because it doesn't appear to be a lombok object: {}.", className);
			}
		}

		assertThat("Expect at least 1 lombok object", validatedClasses.size(), org.hamcrest.Matchers.greaterThan(0));

		return validatedClasses;
	}

	public static void validate(Class<?> clazz)
		throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException
	{
		if (Heuristics.isImmutable(clazz))
		{
			log.info("Lombok Value Class: {}", clazz);
			ValueClassValidator.validate(clazz);
		}
		else
		{
			log.info("Lombok Data Class: {}", clazz);
			DataClassValidator.validate(clazz);
		}
	}
}

@@ -327,16 +327,628 @@
 dator%0A%7B%0A
+%09/**%0A%09 * Picks up all classes in the provided namespace and sub-namespaces. Each class is checked with some heuristics. If the%0A%09 * library thinks it is a class generated through an @Value or @Data annotation, it hands it off to the DataClassValidator or%0A%09 * ValueClassValidator. These in turn generate as much coverage as possible, as well as doing some validation.%0A%09 * %3Cp%3E%0A%09 * An assertion failure will trigger when no objects are found.%0A%09 *%0A%09 * @param namespacePrefix The root namespace from where to start looking for lombok annotated objects.%0A%09 * @return A list of all Classes that have been processed.%0A%09 */%0A
 %09public 
@@ -1538,20 +1538,21 @@
 %09%09%09%09log.
-info
+debug
 (%22Valida
@@ -2209,36 +2209,423 @@
 %0A%0A%09%09
-return validatedClasses;%0A%09%7D%0A
+log.info(%22Automatically validated %7B%7D classes%22, validatedClasses.size());%0A%0A%09%09return validatedClasses;%0A%09%7D%0A%0A%09/**%0A%09 * @param clazz The class to validate. It will both trigger the coverage generator as well as doing some validation on the%0A%09 *                 object itself.%0A%09 * @throws InvocationTargetException%0A%09 * @throws NoSuchMethodException%0A%09 * @throws InstantiationException%0A%09 * @throws IllegalAccessException%0A%09 */
 %0A%09pu
@@ -2815,36 +2815,37 @@
 zz))%0A%09%09%7B%0A%09%09%09log.
-info
+debug
 (%22Lombok Value C
@@ -2925,20 +2925,21 @@
 %0A%09%09%09log.
-info
+debug
 (%22Lombok

Add javadocs