// Path: FlowTwist/test/flow/twist/test/util/selectors/UnitSelector.java
// public interface UnitSelector {
// 	boolean matches(SootMethod method, Unit unit);
// }


import java.util.List;
import java.util.Set;
import org.junit.Assert;
import soot.Unit;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import flow.twist.path.Path;
import flow.twist.path.PathElement;
import flow.twist.test.util.selectors.UnitSelector;
	public Set<Path> getPaths() {
		return paths;
	}

	public PathSelector startsAt(UnitSelector selector) {
		List<Path> matchingPaths = Lists.newLinkedList();
		for (Path path : paths) {
			Unit unit = path.getFirst();
			if (selector.matches(path.context.icfg.getMethodOf(unit), unit)) {
				matchingPaths.add(path);
			}
		}
		return new PathSelector(matchingPaths);
	}

	public class PathSelector {
		private List<Path> paths;

		public PathSelector(List<Path> paths) {
			this.paths = paths;
		}

		public PathSelector endsAt(UnitSelector selector) {
			List<Path> matchingPaths = Lists.newLinkedList();
			for (Path path : paths) {
				Unit unit = path.getLast();
				if (selector.matches(path.context.icfg.getMethodOf(unit), unit)) {
					matchingPaths.add(path);
				}
			}
// Path: FlowTwist/test/flow/twist/test/util/selectors/UnitSelector.java
// public interface UnitSelector {
// 	boolean matches(SootMethod method, Unit unit);
// }


// Path: FlowTwist/test/flow/twist/test/util/PathVerifier.java
import java.util.List;
import java.util.Set;
import org.junit.Assert;
import soot.Unit;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import flow.twist.path.Path;
import flow.twist.path.PathElement;
import flow.twist.test.util.selectors.UnitSelector;

	public Set<Path> getPaths() {
		return paths;
	}

	public PathSelector startsAt(UnitSelector selector) {
		List<Path> matchingPaths = Lists.newLinkedList();
		for (Path path : paths) {
			Unit unit = path.getFirst();
			if (selector.matches(path.context.icfg.getMethodOf(unit), unit)) {
				matchingPaths.add(path);
			}
		}
		return new PathSelector(matchingPaths);
	}

	public class PathSelector {
		private List<Path> paths;

		public PathSelector(List<Path> paths) {
			this.paths = paths;
		}

		public PathSelector endsAt(UnitSelector selector) {
			List<Path> matchingPaths = Lists.newLinkedList();
			for (Path path : paths) {
				Unit unit = path.getLast();
				if (selector.matches(path.context.icfg.getMethodOf(unit), unit)) {
					matchingPaths.add(path);
				}
			}
			return new PathSelector(matchingPaths);