// Path: src/test/java/com/almondtools/rexlex/automaton/Automatons.java
// public static Set<String> matchSamples(Automaton a, String... samples) {
// 	MatchCollector collector = new MatchCollector();
// 	AutomatonMatcher matcher = a.matcher().withListener(collector);
// 	for (String sample : samples) {
// 		matcher.applyTo(chars(sample));
// 	}
// 	return new LinkedHashSet<String>(collector.getMatchedTexts());
// }
// 
// Path: src/main/java/com/almondtools/rexlex/automaton/Automaton.java
// public interface Automaton {
// 	
// 	String getId();
// 	TokenType getErrorType();
// 	
// 	AutomatonProperty getProperty();
// 	Iterable<String> getSamples(int length);
// 	
// 	<T extends Token> Iterator<T> tokenize(CharProvider chars, TokenFactory<T> factory);
// 	
// 	AutomatonMatcher matcher();
// 	
// 	Automaton revert();
// 	
// 	AutomatonExport store(String name);
// 	
// }
// 
// Path: src/test/java/com/almondtools/rexlex/tokens/Accept.java
// public enum Accept implements TokenType {
// 	A,B,C,D,E,F,G,H,I,J,K,L,REMAINDER;
// 
// 	@Override
// 	public boolean error() {
// 		return false;
// 	}
// 	
// 	@Override
// 	public boolean accept() {
// 		return true;
// 	}
// }


import static com.almondtools.rexlex.automaton.Automatons.matchSamples;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.empty;
import static org.junit.Assert.assertThat;
import org.junit.Rule;
import org.junit.Test;
import com.almondtools.rexlex.automaton.Automaton;
import com.almondtools.rexlex.tokens.Accept;
	public void testStringsAreConstant() throws Exception {
		Automaton a = compiler.compile("abcde");
		assertThat(a.getProperty().isLinear(), equalTo(true));
	}

	@Test
	public void testInfiniteCharsAreNotConstant() throws Exception {
		Automaton a = compiler.compile("a*");
		assertThat(a.getProperty().isLinear(), equalTo(false));
	}

	@Test
	public void testAlternativeCharsAreNotConstant() throws Exception {
		Automaton a = compiler.compile("a|b");
		assertThat(a.getProperty().isLinear(), equalTo(false));
	}

	@Test
	public void testConcatsOfConstantAreConstant() throws Exception {
		Automaton a = compiler.compile("(a)(b)");
		assertThat(a.getProperty().isLinear(), equalTo(true));
	}

	@Test
	public void testConcatsOfNonConstantAreNotConstant() throws Exception {
		Automaton a = compiler.compile("(a)(b|c)");
		assertThat(a.getProperty().isLinear(), equalTo(false));
	}

	@Test
// Path: src/test/java/com/almondtools/rexlex/automaton/Automatons.java
// public static Set<String> matchSamples(Automaton a, String... samples) {
// 	MatchCollector collector = new MatchCollector();
// 	AutomatonMatcher matcher = a.matcher().withListener(collector);
// 	for (String sample : samples) {
// 		matcher.applyTo(chars(sample));
// 	}
// 	return new LinkedHashSet<String>(collector.getMatchedTexts());
// }
// 
// Path: src/main/java/com/almondtools/rexlex/automaton/Automaton.java
// public interface Automaton {
// 	
// 	String getId();
// 	TokenType getErrorType();
// 	
// 	AutomatonProperty getProperty();
// 	Iterable<String> getSamples(int length);
// 	
// 	<T extends Token> Iterator<T> tokenize(CharProvider chars, TokenFactory<T> factory);
// 	
// 	AutomatonMatcher matcher();
// 	
// 	Automaton revert();
// 	
// 	AutomatonExport store(String name);
// 	
// }
// 
// Path: src/test/java/com/almondtools/rexlex/tokens/Accept.java
// public enum Accept implements TokenType {
// 	A,B,C,D,E,F,G,H,I,J,K,L,REMAINDER;
// 
// 	@Override
// 	public boolean error() {
// 		return false;
// 	}
// 	
// 	@Override
// 	public boolean accept() {
// 		return true;
// 	}
// }


// Path: src/test/java/com/almondtools/rexlex/pattern/AutomatonTest.java
import static com.almondtools.rexlex.automaton.Automatons.matchSamples;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.empty;
import static org.junit.Assert.assertThat;
import org.junit.Rule;
import org.junit.Test;
import com.almondtools.rexlex.automaton.Automaton;
import com.almondtools.rexlex.tokens.Accept;

	public void testStringsAreConstant() throws Exception {
		Automaton a = compiler.compile("abcde");
		assertThat(a.getProperty().isLinear(), equalTo(true));
	}

	@Test
	public void testInfiniteCharsAreNotConstant() throws Exception {
		Automaton a = compiler.compile("a*");
		assertThat(a.getProperty().isLinear(), equalTo(false));
	}

	@Test
	public void testAlternativeCharsAreNotConstant() throws Exception {
		Automaton a = compiler.compile("a|b");
		assertThat(a.getProperty().isLinear(), equalTo(false));
	}

	@Test
	public void testConcatsOfConstantAreConstant() throws Exception {
		Automaton a = compiler.compile("(a)(b)");
		assertThat(a.getProperty().isLinear(), equalTo(true));
	}

	@Test
	public void testConcatsOfNonConstantAreNotConstant() throws Exception {
		Automaton a = compiler.compile("(a)(b|c)");
		assertThat(a.getProperty().isLinear(), equalTo(false));
	}

	@Test
	public void testOnCharIsFinite() throws Exception {