// 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;

	 * Gets called before each test run. Sets the allowed system exit status to {@link SystemExitStatus#WITH_0}.
	 * Override this method if you wish to have another default system exit status.
	 * <p>
	 * <i>Deprecated. Please use {@link #setAllowedSystemExitStatus(SystemExitStatus)} and
	 * {@link #setExpectedSystemExitStatus(SystemExitStatus)}.
	 */
	@Deprecated
	@Before
	public void defaultSystemExitStatus() {
		TestObject.allowSystemExit(SystemExitStatus.WITH_0);
	}

	/**
	 * Checks the exit status of a tested method. Has to be called after call to a {@link TestObject} run method.
	 * 
	 * @param commands
	 *            The commands that were run on the interactive console.
	 * @param args0
	 *            The arguments the main method was called with in the test run.
	 * @throws IllegalStateException
	 *             If {@link #initSystemExitStatusCheck()} has not been called before the test run.
	 */
	protected final void checkSystemExitStatus(String[] commands, String[] args0) {
		if (!newSystemExitStatusCeckInited) {
			throw new IllegalStateException("The new way of system exit status checking has not been inited yet!");
		}
		if (allowedExitStatus != null || expectedExitStatus != null) {
			Integer actualStatus = TestObject.getLastMethodsSystemExitStatus();
			if (expectedExitStatus != null) {
				assertThat(consoleMessage(commands, args0) + "\nWrong system exit status!", actualStatus,

// 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;

	 * Gets called before each test run. Sets the allowed system exit status to {@link SystemExitStatus#WITH_0}.
	 * Override this method if you wish to have another default system exit status.
	 * <p>
	 * <i>Deprecated. Please use {@link #setAllowedSystemExitStatus(SystemExitStatus)} and
	 * {@link #setExpectedSystemExitStatus(SystemExitStatus)}.
	 */
	@Deprecated
	@Before
	public void defaultSystemExitStatus() {
		TestObject.allowSystemExit(SystemExitStatus.WITH_0);
	}

	/**
	 * Checks the exit status of a tested method. Has to be called after call to a {@link TestObject} run method.
	 * 
	 * @param commands
	 *            The commands that were run on the interactive console.
	 * @param args0
	 *            The arguments the main method was called with in the test run.
	 * @throws IllegalStateException
	 *             If {@link #initSystemExitStatusCheck()} has not been called before the test run.
	 */
	protected final void checkSystemExitStatus(String[] commands, String[] args0) {
		if (!newSystemExitStatusCeckInited) {
			throw new IllegalStateException("The new way of system exit status checking has not been inited yet!");
		}
		if (allowedExitStatus != null || expectedExitStatus != null) {
			Integer actualStatus = TestObject.getLastMethodsSystemExitStatus();
			if (expectedExitStatus != null) {
				assertThat(consoleMessage(commands, args0) + "\nWrong system exit status!", actualStatus,

					suits(expectedExitStatus, true));
