package common;

import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;

/**
 * <p>A TestIterator meant for exploring a space of combinations. As such, removing elements from
 * the backing collection should have an effect on subsequent results from next(). This class
 * provides convenience methods for excluding certain elements of the backing collection from
 * combinations returned from next().</p>
 * @author fiveham
 * @author fiveham
 *
 * @param <T>
 * @param <T>@param <T>
 */
public class IsoIterator<T> extends TestIterator<List<T>> {
	
	protected final Set<T> exclude;
  
    /**
     * <p>Constructs an IsoIterator wrapping the specified Iterator and having no tests.</p>
     * @param wrappedIterator the Iterator that supplies this IsoIterator with elements to test and
     * contingently reduce
     */
	public IsoIterator(Iterator<List<T>> wrappedIterator) {
		super(wrappedIterator);
		this.exclude = new HashSet<>();
		addTest(genExcludeTest(exclude));
	}
	
	public static <T> Predicate<List<T>> genExcludeTest(Set<T> exclude){
		return (list) -> Collections.disjoint(list, exclude);
	}
}

@@ -141,45 +141,8 @@
 Set;
-%0Aimport java.util.function.Predicate;
 %0A%0A/*
@@ -1019,118 +1019,8 @@
 est(
-genExcludeTest(exclude));%0A%09%7D%0A%09%0A%09public static %3CT%3E Predicate%3CList%3CT%3E%3E genExcludeTest(Set%3CT%3E exclude)%7B%0A%09%09return 
 (lis
@@ -1056,16 +1056,21 @@
 st, 
+this.
 exclude)
 ;%0A%09%7D
@@ -1065,15 +1065,16 @@
 exclude)
+)
 ;%0A%09%7D%0A%7D%0A

move disjoint exclusion test lambda into IsoIterator constructor