// Path: src/test/KitMatchers.java
// public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) {
// 	return new BaseMatcher<Integer>() {
// 
// 		@Override
// 		public boolean matches(final Object testObject) {
// 			Integer status = (Integer) testObject;
// 			return systemExitStatus.matches(status, mandatory);
// 		}
// 
// 		@Override
// 		public void describeTo(Description description) {
// 			description.appendText(systemExitStatus.toString());
// 		}
// 
// 		@Override
// 		public void describeMismatch(final Object item, final Description description) {
// 			if (item == null) {
// 				description.appendText("was no call to System.exit at all");
// 			} else {
// 				description.appendText("was System.exit(" + item + ")");
// 			}
// 		}
// 	};
// }
// 
// Path: src/test/framework/FrameworkException.java
// public class FrameworkException extends RuntimeException {
// 	private static final long serialVersionUID = 2221405766881026986L;
// 	private static final String GIT_HUB_POINTER = "This is a serious issue. But we'd like to help solve this!\n"
// 			+ "Please report what happened on GitHub. Create a new issue at:\n"
// 			+ "https://github.com/jGleitz/JUnit-KIT/issues";
// 
// 	/**
// 	 * New Framework Exception.
// 	 *
// 	 * @param message
// 	 *            Detailed error description
// 	 */
// 	public FrameworkException(String message) {
// 		super(message);
// 	}
// 
// 	@Override
// 	public String getMessage() {
// 		String details = super.getMessage();
// 		return details + "\n\n" + GIT_HUB_POINTER;
// 	}
// }
// 
// Path: src/test/runs/NoOutputRun.java
// public class NoOutputRun extends ExactRun {
// 
// 	/**
// 	 * Constructs a test run for the given command that fails if {@code Terminal.printLine} is ever called by the tested
// 	 * class.
// 	 */
// 	public NoOutputRun(String command) {
// 		super(command, "no output at all", new LinkedList<Matcher<String>>());
// 	}
// 
// 	/**
// 	 * Constructs a test run without a command that fails if {@code Terminal.printLine} is ever called by the tested
// 	 * class. Use only to test errors before the first command.
// 	 */
// 	public NoOutputRun() {
// 		this(null);
// 	}
// }
// 
// Path: src/test/runs/Run.java
// public interface Run {
// 
// 	/**
// 	 * Checks whether the output of the tested class does fulfil the needs defined by this run. Throws an exception if
// 	 * it doesn't.
// 	 * 
// 	 * @param testedClassOutput
// 	 *            The output of the tested class for this run. One String represents one call to
// 	 *            {@code Terminal.printLine}.
// 	 * @param errorMessage
// 	 *            The message that will be reported to {@link org.junit.Assert#fail(String)} or
// 	 *            {@link org.junit.Assert#assertThat(String, Object, org.hamcrest.Matcher)}
// 	 * @throws RunFailedException
// 	 *             If {@code testedClassOutput} does not fulfil this test run's expected output.
// 	 */
// 	public void check(String[] testedClassOutput, String errorMessage);
// 
// 	/**
// 	 * @return The command that is to be run on the interactive console for this test run.
// 	 */
// 	public String getCommand();
// 
// 	/**
// 	 * @return A String describing what this test run expects the tested class to print.
// 	 */
// 	public String getExpectedDescription();
// }


import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static test.KitMatchers.suits;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.hamcrest.Matcher;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.Timeout;
import test.framework.FrameworkException;
import test.runs.NoOutputRun;
import test.runs.Run;

	 * 
	 * @see Run
	 * @param initOutputRun
	 *            A run specifying the output before the first run of {@code runs} is run. The command of this run is
	 *            irrelevant, it will never be excuted.
	 * @param runs
	 *            The runs to run on the interactive console.
	 * @param args0
	 *            The arguments for the {@code main}-method
	 */
	protected void sessionTest(Run initOutputRun, Run[] runs, String... args0) {
		String[] commands = new String[runs.length];
		for (int i = 0; i < runs.length; i++) {
			commands[i] = runs[i].getCommand();
		}

		initSystemExitStatusCheck();
		TestObject.resetClass();
		TestObject.setNextMethodCallInput(commands);
		TestObject.runStaticVoid("main", (Object) args0);
		OutputFileWriter.documentRun(args0);
		String[][] result = TestObject.getLastMethodsGroupedOutput();

		StringBuilder errorMessageBuilder = new StringBuilder();
		errorMessageBuilder.append(consoleMessage(commands, args0));
		errorMessageBuilder.append("the first error occurred before the first command was run:");
		errorMessageBuilder.append("\n");
		initOutputRun.check(result[0], errorMessageBuilder.toString());

		for (int j = 1; j < result.length; j++) {

// Path: src/test/KitMatchers.java
// public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) {
// 	return new BaseMatcher<Integer>() {
// 
// 		@Override
// 		public boolean matches(final Object testObject) {
// 			Integer status = (Integer) testObject;
// 			return systemExitStatus.matches(status, mandatory);
// 		}
// 
// 		@Override
// 		public void describeTo(Description description) {
// 			description.appendText(systemExitStatus.toString());
// 		}
// 
// 		@Override
// 		public void describeMismatch(final Object item, final Description description) {
// 			if (item == null) {
// 				description.appendText("was no call to System.exit at all");
// 			} else {
// 				description.appendText("was System.exit(" + item + ")");
// 			}
// 		}
// 	};
// }
// 
// Path: src/test/framework/FrameworkException.java
// public class FrameworkException extends RuntimeException {
// 	private static final long serialVersionUID = 2221405766881026986L;
// 	private static final String GIT_HUB_POINTER = "This is a serious issue. But we'd like to help solve this!\n"
// 			+ "Please report what happened on GitHub. Create a new issue at:\n"
// 			+ "https://github.com/jGleitz/JUnit-KIT/issues";
// 
// 	/**
// 	 * New Framework Exception.
// 	 *
// 	 * @param message
// 	 *            Detailed error description
// 	 */
// 	public FrameworkException(String message) {
// 		super(message);
// 	}
// 
// 	@Override
// 	public String getMessage() {
// 		String details = super.getMessage();
// 		return details + "\n\n" + GIT_HUB_POINTER;
// 	}
// }
// 
// Path: src/test/runs/NoOutputRun.java
// public class NoOutputRun extends ExactRun {
// 
// 	/**
// 	 * Constructs a test run for the given command that fails if {@code Terminal.printLine} is ever called by the tested
// 	 * class.
// 	 */
// 	public NoOutputRun(String command) {
// 		super(command, "no output at all", new LinkedList<Matcher<String>>());
// 	}
// 
// 	/**
// 	 * Constructs a test run without a command that fails if {@code Terminal.printLine} is ever called by the tested
// 	 * class. Use only to test errors before the first command.
// 	 */
// 	public NoOutputRun() {
// 		this(null);
// 	}
// }
// 
// Path: src/test/runs/Run.java
// public interface Run {
// 
// 	/**
// 	 * Checks whether the output of the tested class does fulfil the needs defined by this run. Throws an exception if
// 	 * it doesn't.
// 	 * 
// 	 * @param testedClassOutput
// 	 *            The output of the tested class for this run. One String represents one call to
// 	 *            {@code Terminal.printLine}.
// 	 * @param errorMessage
// 	 *            The message that will be reported to {@link org.junit.Assert#fail(String)} or
// 	 *            {@link org.junit.Assert#assertThat(String, Object, org.hamcrest.Matcher)}
// 	 * @throws RunFailedException
// 	 *             If {@code testedClassOutput} does not fulfil this test run's expected output.
// 	 */
// 	public void check(String[] testedClassOutput, String errorMessage);
// 
// 	/**
// 	 * @return The command that is to be run on the interactive console for this test run.
// 	 */
// 	public String getCommand();
// 
// 	/**
// 	 * @return A String describing what this test run expects the tested class to print.
// 	 */
// 	public String getExpectedDescription();
// }


// Path: src/test/InteractiveConsoleTest.java
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static test.KitMatchers.suits;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.hamcrest.Matcher;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.Timeout;
import test.framework.FrameworkException;
import test.runs.NoOutputRun;
import test.runs.Run;

	 * 
	 * @see Run
	 * @param initOutputRun
	 *            A run specifying the output before the first run of {@code runs} is run. The command of this run is
	 *            irrelevant, it will never be excuted.
	 * @param runs
	 *            The runs to run on the interactive console.
	 * @param args0
	 *            The arguments for the {@code main}-method
	 */
	protected void sessionTest(Run initOutputRun, Run[] runs, String... args0) {
		String[] commands = new String[runs.length];
		for (int i = 0; i < runs.length; i++) {
			commands[i] = runs[i].getCommand();
		}

		initSystemExitStatusCheck();
		TestObject.resetClass();
		TestObject.setNextMethodCallInput(commands);
		TestObject.runStaticVoid("main", (Object) args0);
		OutputFileWriter.documentRun(args0);
		String[][] result = TestObject.getLastMethodsGroupedOutput();

		StringBuilder errorMessageBuilder = new StringBuilder();
		errorMessageBuilder.append(consoleMessage(commands, args0));
		errorMessageBuilder.append("the first error occurred before the first command was run:");
		errorMessageBuilder.append("\n");
		initOutputRun.check(result[0], errorMessageBuilder.toString());

		for (int j = 1; j < result.length; j++) {

			Run run = runs[j - 1];
