// Path: main/com/dhemery/runtimesuite/MethodFilter.java
// public interface MethodFilter {
// 	/**
// 	 * Indicates whether a method satisfies this filter's criteria.
// 	 * @param method the method to assess against this filter's criteria.
// 	 * @return {@code true} only if {@code method} satisfies this filter's criteria.
// 	 */
// 	boolean passes(Method method);
// }
// 
// Path: main/com/dhemery/runtimesuite/filters/IncludeMethodCategories.java
// public class IncludeMethodCategories implements MethodFilter {
// 	private final CategoryMatcher<Method> matcher;
// 
// 	/**
// 	 * @param allowedCategories the list of categories allowed by this filter.
// 	 */
// 	public IncludeMethodCategories(Class<?>...allowedCategories) {
// 		matcher = new CategoryMatcher<Method>(allowedCategories);
// 	}
// 
// 	/**
// 	 * Accepts a method if it is in an allowed category.
// 	 * @param candidateMethod the method to evaluate.
// 	 * @return {@code true} if {@code candidateMethod} is in one or more allowed categories,
// 	 * otherwise {@code false}. 
// 	 */
// 	public boolean passes(Method candidateMethod) {
// 		return matcher.hasMatchingCategory(candidateMethod);
// 	}
// }
// 
// Path: examples/example/categories/CategoryA.java
// public interface CategoryA {}
// 
// Path: examples/example/categories/CategoryB.java
// public interface CategoryB {}
// 
// Path: examples/example/tests/ClassWithCategorizedMethods.java
// public class ClassWithCategorizedMethods {
// 	@Test public void methodWithNoCategories() {}
// 
// 	@Category(CategoryA.class)
// 	@Test public void methodInCategoryA() {}
// 
// 	@Category(CategoryB.class)
// 	@Test public void methodInCategoryB() {}
// 
// 	@Category({CategoryA.class, CategoryB.class})
// 	@Test public void methodInCategoriesAandB() {}
// 
// 	@Category({CategoryC.class, CategoryD.class})
// 	@Test public void methodInCategoriesCandD() {}		
// }


import org.junit.Test;
import static org.junit.Assert.*;
import com.dhemery.runtimesuite.MethodFilter;
import com.dhemery.runtimesuite.filters.IncludeMethodCategories;
import example.categories.CategoryA;
import example.categories.CategoryB;
import example.tests.ClassWithCategorizedMethods;
package com.dhemery.runtimesuite.tests;







public class AnIncludeMethodCategoriesFilter {
	private Class<?> targetClass = ClassWithCategorizedMethods.class;

	@Test
	public void forAnEmptyCategoryList_passesNoMethods() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories();
		assertFalse(filter.passes(targetClass.getMethod("methodWithNoCategories")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoryA")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoryB")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoriesAandB")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoriesCandD")));
	}

	@Test
	public void forASingleCategory_passesEachMethodInThatCategory() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories(CategoryA.class);
		assertTrue(filter.passes(targetClass.getMethod("methodInCategoryA")));
		assertTrue(filter.passes(targetClass.getMethod("methodInCategoriesAandB")));
	}

	@Test
	public void forASingleCategory_rejectsEachMethodNotInThatCategory() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories(CategoryA.class);
		assertFalse(filter.passes(targetClass.getMethod("methodWithNoCategories")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoryB")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoriesCandD")));
	}
	
	@Test
	public void forMultipleCategories_passesEachMethodInAnySpecifiedCategory() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories(CategoryA.class, CategoryB.class);
// Path: main/com/dhemery/runtimesuite/MethodFilter.java
// public interface MethodFilter {
// 	/**
// 	 * Indicates whether a method satisfies this filter's criteria.
// 	 * @param method the method to assess against this filter's criteria.
// 	 * @return {@code true} only if {@code method} satisfies this filter's criteria.
// 	 */
// 	boolean passes(Method method);
// }
// 
// Path: main/com/dhemery/runtimesuite/filters/IncludeMethodCategories.java
// public class IncludeMethodCategories implements MethodFilter {
// 	private final CategoryMatcher<Method> matcher;
// 
// 	/**
// 	 * @param allowedCategories the list of categories allowed by this filter.
// 	 */
// 	public IncludeMethodCategories(Class<?>...allowedCategories) {
// 		matcher = new CategoryMatcher<Method>(allowedCategories);
// 	}
// 
// 	/**
// 	 * Accepts a method if it is in an allowed category.
// 	 * @param candidateMethod the method to evaluate.
// 	 * @return {@code true} if {@code candidateMethod} is in one or more allowed categories,
// 	 * otherwise {@code false}. 
// 	 */
// 	public boolean passes(Method candidateMethod) {
// 		return matcher.hasMatchingCategory(candidateMethod);
// 	}
// }
// 
// Path: examples/example/categories/CategoryA.java
// public interface CategoryA {}
// 
// Path: examples/example/categories/CategoryB.java
// public interface CategoryB {}
// 
// Path: examples/example/tests/ClassWithCategorizedMethods.java
// public class ClassWithCategorizedMethods {
// 	@Test public void methodWithNoCategories() {}
// 
// 	@Category(CategoryA.class)
// 	@Test public void methodInCategoryA() {}
// 
// 	@Category(CategoryB.class)
// 	@Test public void methodInCategoryB() {}
// 
// 	@Category({CategoryA.class, CategoryB.class})
// 	@Test public void methodInCategoriesAandB() {}
// 
// 	@Category({CategoryC.class, CategoryD.class})
// 	@Test public void methodInCategoriesCandD() {}		
// }


// Path: test/com/dhemery/runtimesuite/tests/AnIncludeMethodCategoriesFilter.java
import org.junit.Test;
import static org.junit.Assert.*;
import com.dhemery.runtimesuite.MethodFilter;
import com.dhemery.runtimesuite.filters.IncludeMethodCategories;
import example.categories.CategoryA;
import example.categories.CategoryB;
import example.tests.ClassWithCategorizedMethods;

package com.dhemery.runtimesuite.tests;







public class AnIncludeMethodCategoriesFilter {
	private Class<?> targetClass = ClassWithCategorizedMethods.class;

	@Test
	public void forAnEmptyCategoryList_passesNoMethods() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories();
		assertFalse(filter.passes(targetClass.getMethod("methodWithNoCategories")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoryA")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoryB")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoriesAandB")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoriesCandD")));
	}

	@Test
	public void forASingleCategory_passesEachMethodInThatCategory() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories(CategoryA.class);
		assertTrue(filter.passes(targetClass.getMethod("methodInCategoryA")));
		assertTrue(filter.passes(targetClass.getMethod("methodInCategoriesAandB")));
	}

	@Test
	public void forASingleCategory_rejectsEachMethodNotInThatCategory() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories(CategoryA.class);
		assertFalse(filter.passes(targetClass.getMethod("methodWithNoCategories")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoryB")));
		assertFalse(filter.passes(targetClass.getMethod("methodInCategoriesCandD")));
	}
	
	@Test
	public void forMultipleCategories_passesEachMethodInAnySpecifiedCategory() throws SecurityException, NoSuchMethodException {
		MethodFilter filter = new IncludeMethodCategories(CategoryA.class, CategoryB.class);
		assertTrue(filter.passes(targetClass.getMethod("methodInCategoryA")));